Skip to content

Commit

Permalink
Update YouTube replace rules
Browse files Browse the repository at this point in the history
Don't remove "Live ..." suffix.

Resolves #15.
  • Loading branch information
alexesprit committed May 7, 2020
1 parent 8ddb74b commit 4910c3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ class MetadataFilter {
{ source: /\sclip/i, target: '' },
// Full Album
{ source: /full\s*album/i, target: '' },
// live
{ source: /\s+live.*?$/i, target: '' },
// (live)
{ source: /\(live.*?\)$/i, target: '' },
// | something
Expand Down
20 changes: 12 additions & 8 deletions test/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,6 @@ const YOUTUBE_FILTER_RULES_TEST_DATA = [{
description: 'should remove "(Stream)" string',
source: 'Track Title (Stream)',
expected: 'Track Title'
}, {
description: 'should remove live suffix',
source: 'Track Title Live',
expected: 'Track Title'
}, {
description: 'should not remove "live" from string',
source: 'Fully Alive',
expected: 'Fully Alive'
}, {
description: 'should remove (live) suffix',
source: 'Track Title (Live)',
Expand Down Expand Up @@ -328,6 +320,18 @@ const YOUTUBE_FILTER_RULES_TEST_DATA = [{
description: 'should remove "(whatever 2/12/18)" string',
source: 'Track Title (whatever 2/12/18)',
expected: 'Track Title'
}, {
description: 'should not remove trailing "Live" word',
source: 'Track Title Live',
expected: 'Track Title Live'
}, {
description: 'should not remove "Live" word',
source: 'Track Live Title',
expected: 'Track Live Title'
}, {
description: 'should not remove "live" as a part of a word from string',
source: 'Fully Alive',
expected: 'Fully Alive'
}];

/**
Expand Down

0 comments on commit 4910c3c

Please sign in to comment.