Merge pull request #571 from iiPythonx/dynamicbg

[bugfix]: Add a fallback image to the dynamic background url
This commit is contained in:
Kendall Garner 2024-04-03 01:54:15 +00:00 committed by GitHub
commit 24394fa858
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -472,12 +472,10 @@ export const FullScreenPlayer = () => {
srcLoaded: true,
});
const imageUrl = currentSong?.imageUrl;
const imageUrl = currentSong?.imageUrl && currentSong.imageUrl.replace(/size=\d+/g, 'size=500');
const backgroundImage =
imageUrl && dynamicIsImage
? `url("${imageUrl
.replace(/size=\d+/g, 'size=500')
.replace(currentSong.id, currentSong.albumId)}`
? `url("${imageUrl.replace(currentSong.id, currentSong.albumId)}"), url("${imageUrl}")`
: mainBackground;
return (