Update index.js

This commit is contained in:
booploops 2021-12-07 16:25:07 -08:00
parent 7e4e086792
commit 4d2a06ed8f

View file

@ -919,10 +919,7 @@ const app = new Vue({
} }
}, },
getMediaItemArtwork(url, size = 64) { getMediaItemArtwork(url, size = 64) {
var newurl = `${url.replace('{w}', size).replace('{h}', size).replace('{f}', "webp").replace('{c}', "cc")}`; var newurl = `${url.replace('{w}', size).replace('{h}', size).replace('{f}', "webp").replace('{c}', "cc")}`;
// replace the only the last instance of .jpg with .webp but not the first instance
newurl = newurl.replace(/\.jpg(?=\?|$)/, '.webp');
return newurl return newurl
}, },
getNowPlayingArtworkBG(size = 600) { getNowPlayingArtworkBG(size = 600) {