Skip to content

Commit

Permalink
add a fallback image to the dynamic background url
Browse files Browse the repository at this point in the history
  • Loading branch information
iiPythonx committed Apr 2, 2024
1 parent 65eca32 commit f7c6088
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit f7c6088

Please sign in to comment.