chore: perf improvements

This commit is contained in:
Cory Dransfeldt 2023-05-26 17:09:02 -07:00
parent bb9a086c32
commit de5cb2db8b
No known key found for this signature in database
4 changed files with 21 additions and 6 deletions

View file

@ -5,7 +5,13 @@ module.exports = {
`https://cdn.coryd.dev/artists/${media.replace(/\s+/g, '-').toLowerCase()}.jpg`,
album: (media) => {
return !ALBUM_DENYLIST.includes(media.name.replace(/\s+/g, '-').toLowerCase())
? media.image[media.image.length - 1]['#text']
: `https://cdn.coryd.dev/artists/${media.name.replace(/\s+/g, '-').toLowerCase()}.jpg`
? media.image[media.image.length - 1]['#text'].replace(
'https://lastfm.freetls.fastly.net',
'https://albums.coryd.dev'
)
: `https://cdn.coryd.dev/albums/${media.name.replace(/\s+/g, '-').toLowerCase()}.jpg`
},
proxy: (url, host, cdn) => {
return url.replace(host, cdn)
},
}