chore: Prettified Code
[ci skip]
This commit is contained in:
parent
a023bd619c
commit
c32b9b6d70
2 changed files with 57 additions and 58 deletions
|
@ -2002,15 +2002,18 @@ const app = new Vue({
|
|||
}
|
||||
if (kind.toString().includes("apple-curator")) {
|
||||
kind = "appleCurator";
|
||||
app.getTypeFromID("appleCurator", id, false, {
|
||||
platform: "web",
|
||||
include: "grouping,playlists",
|
||||
extend: "editorialArtwork",
|
||||
"art[url]": "f",
|
||||
}).then(() => {
|
||||
kind = "appleCurator";
|
||||
window.location.hash = `${kind}/${id}`;
|
||||
document.querySelector("#app-content").scrollTop = 0});
|
||||
app
|
||||
.getTypeFromID("appleCurator", id, false, {
|
||||
platform: "web",
|
||||
include: "grouping,playlists",
|
||||
extend: "editorialArtwork",
|
||||
"art[url]": "f",
|
||||
})
|
||||
.then(() => {
|
||||
kind = "appleCurator";
|
||||
window.location.hash = `${kind}/${id}`;
|
||||
document.querySelector("#app-content").scrollTop = 0;
|
||||
});
|
||||
} else if (kind == "editorial-elements" || kind == "editorial-items") {
|
||||
console.debug(item);
|
||||
if (item.relationships?.contents?.data != null && item.relationships?.contents?.data.length > 0) {
|
||||
|
@ -4024,26 +4027,26 @@ const app = new Vue({
|
|||
},
|
||||
getMediaItemArtwork(url, height = 64, width) {
|
||||
try {
|
||||
if (typeof url == "undefined" || url == "") {
|
||||
return "./assets/MissingArtwork.svg";
|
||||
}
|
||||
height = parseInt(height * window.devicePixelRatio);
|
||||
if (width) {
|
||||
width = parseInt(width * window.devicePixelRatio);
|
||||
}
|
||||
let newurl = `${(url ?? "")
|
||||
.replace("{w}", width ?? height)
|
||||
.replace("{h}", height)
|
||||
.replace("{f}", "webp")
|
||||
.replace("{c}", width === 900 || width === 380 || width === 600 ? "sr" : "cc")}`;
|
||||
if (typeof url == "undefined" || url == "") {
|
||||
return "./assets/MissingArtwork.svg";
|
||||
}
|
||||
height = parseInt(height * window.devicePixelRatio);
|
||||
if (width) {
|
||||
width = parseInt(width * window.devicePixelRatio);
|
||||
}
|
||||
let newurl = `${(url ?? "")
|
||||
.replace("{w}", width ?? height)
|
||||
.replace("{h}", height)
|
||||
.replace("{f}", "webp")
|
||||
.replace("{c}", width === 900 || width === 380 || width === 600 ? "sr" : "cc")}`;
|
||||
|
||||
if (newurl.includes("900x516")) {
|
||||
newurl = newurl.replace("900x516cc", "900x516sr").replace("900x516bb", "900x516sr");
|
||||
}
|
||||
return newurl;}
|
||||
catch (e) {
|
||||
console.log(url)
|
||||
return "./assets/MissingArtwork.svg"
|
||||
if (newurl.includes("900x516")) {
|
||||
newurl = newurl.replace("900x516cc", "900x516sr").replace("900x516bb", "900x516sr");
|
||||
}
|
||||
return newurl;
|
||||
} catch (e) {
|
||||
console.log(url);
|
||||
return "./assets/MissingArtwork.svg";
|
||||
}
|
||||
},
|
||||
_rgbToRgb(rgb = [0, 0, 0]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue