music: make smart trimming work

This commit is contained in:
end-4
2024-02-19 20:19:15 +07:00
parent ab563e0c00
commit 3cc8c3b7d8
@@ -71,11 +71,11 @@ function getTrackfont(player) {
} }
function trimTrackTitle(title) { function trimTrackTitle(title) {
if (!title) return ''; if (!title) return '';
const cleanRegexes = [ const cleanPatterns = [
/【[^】]*】/, // Touhou n weeb stuff /【[^】]*】/, // Touhou n weeb stuff
/\[FREE DOWNLOAD\]/, // F-777 " [FREE DOWNLOAD]", // F-777
]; ];
cleanRegexes.forEach((expr) => title.replace(expr, '')); cleanPatterns.forEach((expr) => title = title.replace(expr, ''));
return title; return title;
} }