mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
use regex on cleanupName()
This commit is contained in:
@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user