Skip to content

Commit

Permalink
Move back rule to filter (HD)/(HQ) suffix
Browse files Browse the repository at this point in the history
Closes #82.
  • Loading branch information
alexesprit committed Nov 22, 2020
1 parent 25b6f12 commit 883efdc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ export const YOUTUBE_TRACK_FILTER_RULES: FilterRule[] = [
{ 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
10 changes: 10 additions & 0 deletions test/function/youtube.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,21 @@ testFilterFunction(youtube, [
funcParameter: 'Track Title HD',
expectedValue: 'Track Title',
},
{
description: 'should remove "(HD)" string',
funcParameter: 'Track Title (HD)',
expectedValue: 'Track Title',
},
{
description: 'should remove "HQ" string',
funcParameter: 'Track Title HQ',
expectedValue: 'Track Title',
},
{
description: 'should remove "(HQ)" string',
funcParameter: 'Track Title (HQ)',
expectedValue: 'Track Title',
},
{
description: 'should extract title from single quotes',
funcParameter: "'Track Title'",
Expand Down

0 comments on commit 883efdc

Please sign in to comment.