Skip to content

Commit

Permalink
Move back rule to filter (HD)/(HQ) suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexesprit committed Nov 22, 2020
1 parent 67f7fb5 commit a92a053
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ class MetadataFilter {
{ source: /\(\s*of+icial\s*\)/i, target: '' },
// (1999)
{ source: /\(\s*[0-9]{4}\s*\)/i, target: '' },
// HD (HQ)
{ source: /(HD|HQ)\s*$/, target: '' },
// (HD) / (HQ)
{ source: /\(\s*(HD|HQ)\s*\)$/, target: '' },
// HD / HQ
{ source: /(HD|HQ)\s?$/, target: '' },
// video clip officiel or video clip official
{ source: /(vid[\u00E9e]o)?\s?clip\sof+ici[ae]l/i, target: '' },
// offizielles
Expand Down
8 changes: 8 additions & 0 deletions test/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,18 @@ const YOUTUBE_FILTER_RULES_TEST_DATA = [{
description: 'should remove "HD" string',
source: 'Track Title HD',
expected: 'Track Title'
}, {
description: 'should remove "(HD)" string',
source: 'Track Title (HD)',
expected: 'Track Title'
}, {
description: 'should remove "HQ" string',
source: 'Track Title HQ',
expected: 'Track Title'
}, {
description: 'should remove "(HQ)" string',
source: 'Track Title (HQ)',
expected: 'Track Title'
}, {
description: 'should extract title from single quotes',
source: '\'Track Title\'',
Expand Down

0 comments on commit a92a053

Please sign in to comment.