mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
feat: split album title
This commit is contained in:
parent
3788f4ae38
commit
a41719fb48
2 changed files with 98 additions and 7 deletions
|
|
@ -107,3 +107,67 @@ export function changeAppearance(appearance) {
|
|||
.querySelector('meta[name="theme-color"]')
|
||||
.setAttribute("content", appearance === "dark" ? "#222" : "#fff");
|
||||
}
|
||||
|
||||
export function splitSoundtrackAlbumTitle(title) {
|
||||
let keywords = [
|
||||
"Music from the Original Motion Picture Score",
|
||||
"The Original Motion Picture Soundtrack",
|
||||
"Original MGM Motion Picture Soundtrack",
|
||||
"Complete Original Motion Picture Score",
|
||||
"Original Music From The Motion Picture",
|
||||
"Original Music From The Netflix Film",
|
||||
"Original Score to the Motion Picture",
|
||||
"Original Motion Picture Soundtrack",
|
||||
"Soundtrack from the Motion Picture",
|
||||
"Original Television Soundtrack",
|
||||
"Original Motion Picture Score",
|
||||
"Music From the Motion Picture",
|
||||
"Music From The Motion Picture",
|
||||
"Complete Motion Picture Score",
|
||||
"Music from the Motion Picture",
|
||||
"Original Videogame Soundtrack",
|
||||
"La Bande Originale du Film",
|
||||
"Music from the Miniseries",
|
||||
"Bande Originale du Film",
|
||||
"Die Original Filmmusik",
|
||||
"Original Soundtrack",
|
||||
"Complete Score",
|
||||
"Original Score",
|
||||
];
|
||||
for (let keyword of keywords) {
|
||||
if (title.includes(keyword) === false) continue;
|
||||
return {
|
||||
title: title
|
||||
.replace(`(${keyword})`, "")
|
||||
.replace(`: ${keyword}`, "")
|
||||
.replace(`[${keyword}]`, "")
|
||||
.replace(`- ${keyword}`, "")
|
||||
.replace(`${keyword}`, ""),
|
||||
subtitle: keyword,
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: title,
|
||||
subtitle: "",
|
||||
};
|
||||
}
|
||||
|
||||
export function splitAlbumTitle(title) {
|
||||
let keywords = ["Bonus Tracks Edition", "Complete Edition", "Deluxe Edition"];
|
||||
for (let keyword of keywords) {
|
||||
if (title.includes(keyword) === false) continue;
|
||||
return {
|
||||
title: title
|
||||
.replace(`(${keyword})`, "")
|
||||
.replace(`: ${keyword}`, "")
|
||||
.replace(`[${keyword}]`, "")
|
||||
.replace(`- ${keyword}`, "")
|
||||
.replace(`${keyword}`, ""),
|
||||
subtitle: keyword,
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: title,
|
||||
subtitle: "",
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue