Skip to content

Commit

Permalink
Improve Youtube filter
Browse files Browse the repository at this point in the history
Update rule to remove "Live" suffix.
Added more test cases.
  • Loading branch information
alexesprit committed Jun 7, 2019
1 parent 99e8e12 commit 5cb3030
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/content/filter.js
Expand Up @@ -324,7 +324,7 @@ class MetadataFilter {
// Full Album
{ source: /\s*full\s*album/i, target: '' },
// live
{ source: /\s+\(?live\)?$/i, target: '' },
{ source: /\s+\(?live.*?\)?$/i, target: '' },
// | something
{ source: /\|.*$/i, target: '' },
// Leftovers after e.g. (official video)
Expand Down
8 changes: 8 additions & 0 deletions tests/core/filter.js
Expand Up @@ -216,6 +216,14 @@ const YOUTUBE_TEST_DATA = [{
description: 'should remove live suffix',
source: 'Track Title Live',
expected: 'Track Title'
}, {
description: 'should remove (live) suffix',
source: 'Track Title (Live)',
expected: 'Track Title'
}, {
description: 'should remove (live ...) suffix',
source: 'Track Title (Live at somewhere)',
expected: 'Track Title'
}, {
description: 'should remove Full Album suffix',
source: 'Track Title Full Album',
Expand Down

0 comments on commit 5cb3030

Please sign in to comment.