Skip to content

Commit

Permalink
use regex on cleanupName()
Browse files Browse the repository at this point in the history
  • Loading branch information
Araxeus committed Jan 29, 2022
1 parent eff0995 commit b042d0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions providers/song-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,12 @@ const suffixesToRemove = [
" - topic",
"vevo",
" (performance video)",
" (official music video)",
" (official video)",
" (clip officiel)",
];

function cleanupName(name) {
if (!name) return name;
name = name.replace(/\((?:official)?[ ]?(?:music)?[ ]?(?:lyric[s]?)?[ ]?(?:video)?\)$/i, '')
const lowCaseName = name.toLowerCase();
for (const suffix of suffixesToRemove) {
if (lowCaseName.endsWith(suffix)) {
Expand Down

0 comments on commit b042d0a

Please sign in to comment.