clarify var names in cleanupName()

This commit is contained in:
Araxeus
2021-10-23 17:18:58 +03:00
parent 2d518abc19
commit 9b1a5b8d26

View File

@ -107,15 +107,15 @@ const suffixesToRemove = [
" (clip officiel)",
];
function cleanupName(artist) {
if (!artist) return artist;
const lowerCaseArtist = artist.toLowerCase();
function cleanupName(name) {
if (!name) return name;
const lowCaseName = name.toLowerCase();
for (const suffix of suffixesToRemove) {
if (lowerCaseArtist.endsWith(suffix)) {
return artist.slice(0, -suffix.length);
if (lowCaseName.endsWith(suffix)) {
return name.slice(0, -suffix.length);
}
}
return artist;
return name;
}
module.exports = registerCallback;