mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 20:01:47 +00:00
clarify var names in cleanupName()
This commit is contained in:
@ -107,15 +107,15 @@ const suffixesToRemove = [
|
|||||||
" (clip officiel)",
|
" (clip officiel)",
|
||||||
];
|
];
|
||||||
|
|
||||||
function cleanupName(artist) {
|
function cleanupName(name) {
|
||||||
if (!artist) return artist;
|
if (!name) return name;
|
||||||
const lowerCaseArtist = artist.toLowerCase();
|
const lowCaseName = name.toLowerCase();
|
||||||
for (const suffix of suffixesToRemove) {
|
for (const suffix of suffixesToRemove) {
|
||||||
if (lowerCaseArtist.endsWith(suffix)) {
|
if (lowCaseName.endsWith(suffix)) {
|
||||||
return artist.slice(0, -suffix.length);
|
return name.slice(0, -suffix.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return artist;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = registerCallback;
|
module.exports = registerCallback;
|
||||||
|
|||||||
Reference in New Issue
Block a user