Fix fallback images, Phas fallback image

This commit is contained in:
bingus_violet 2024-03-23 12:37:22 -05:00
parent 8c2c22ef27
commit e40e4573e7
3 changed files with 8 additions and 14 deletions

View file

@ -1,6 +1,7 @@
{
"activityImages": {
"ULTRAKILL": "https://cdn.violets-purgatory.dev/fallbackImages/ULTRAKILL.webp"
"ULTRAKILL": "https://fs.violets-purgatory.dev/SiteActivityImages/ULTRAKILL.jpg",
"Phasmophobia": "https://fs.violets-purgatory.dev/SiteActivityImages/Phasmophobia.png"
},
"discStatuses": {
"online": {

View file

@ -6,7 +6,6 @@ var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')))
var activityImages = config.activityImages
function get_img_url(activity, size = "large_image") {
if ("assets" in activity) {
var image = activity.assets[size]
@ -15,20 +14,17 @@ function get_img_url(activity, size = "large_image") {
return decodeURIComponent('https://' + image.substr(image.indexOf('https/') + 6, image.length))
} else if (image.includes("spotify")) {
return decodeURIComponent('https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length))
} else {
return decodeURIComponent(`https://cdn.discordapp.com/app-assets/${activity.application_id}/${image}.png`)
}
}
}
if (!image) {
if (!image && size == "large_image") {
if (activity.name in activityImages) {
return decodeURIComponent(activityImages[activity.name])
} else {
}
}
return null
}
}
}
function timeFormatter(seconds) {

View file

@ -170,20 +170,17 @@ function get_img_url(activity, size = "large_image") {
return decodeURIComponent('https://' + image.substr(image.indexOf('https/') + 6, image.length))
} else if (image.includes("spotify")) {
return decodeURIComponent('https://i.scdn.co/image/' + image.substr(image.indexOf('spotify:') + 8, image.length))
} else {
return decodeURIComponent(`https://cdn.discordapp.com/app-assets/${activity.application_id}/${image}.png`)
}
}
}
if (!image) {
if (!image && size == "large_image") {
if (activity.name in activityImages) {
return decodeURIComponent(activityImages[activity.name])
} else {
}
}
return null
}
}
}
function socketeer() {