From b042d0a8ca412717e35e03a6589908738fbc1787 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Sat, 29 Jan 2022 17:57:39 +0200 Subject: [PATCH] use regex on cleanupName() --- providers/song-info.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/providers/song-info.js b/providers/song-info.js index c4028355..88f757a3 100644 --- a/providers/song-info.js +++ b/providers/song-info.js @@ -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)) {