Fix weird behaviors with mp:external I hope

This commit is contained in:
bingus_violet 2024-10-13 15:40:45 -05:00
parent 7c89ef047d
commit 7a3d81ce4a

View file

@ -75,7 +75,9 @@ function get_img_url(activity, size = "large_image") {
var image = activity.assets[size] var image = activity.assets[size]
if (image) { if (image) {
if (image.includes("https/")) { if (image.includes("mp:external")) {
return ('https://media.discordapp.net/external' + image.substr(image.indexOf('mp:external') + 11, image.length))
} else if (image.includes("https/")) {
return decodeURIComponent('https://' + image.substr(image.indexOf('https/') + 6, image.length)) return decodeURIComponent('https://' + image.substr(image.indexOf('https/') + 6, image.length))
} else if (image.includes("spotify")) { } else if (image.includes("spotify")) {
return decodeURIComponent('https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length)) return decodeURIComponent('https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length))