Skip to content

Commit

Permalink
clarify var names in cleanupName()
Browse files Browse the repository at this point in the history
  • Loading branch information
Araxeus committed Oct 23, 2021
1 parent 2d518ab commit 9b1a5b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions providers/song-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9b1a5b8

Please sign in to comment.