From f7c6088ccaeb18c4c7b28e637fb128a24528c39e Mon Sep 17 00:00:00 2001 From: iiPython Date: Tue, 2 Apr 2024 12:56:36 -0500 Subject: [PATCH] add a fallback image to the dynamic background url --- .../features/player/components/full-screen-player.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/renderer/features/player/components/full-screen-player.tsx b/src/renderer/features/player/components/full-screen-player.tsx index 08aa84704..f3c2d7104 100644 --- a/src/renderer/features/player/components/full-screen-player.tsx +++ b/src/renderer/features/player/components/full-screen-player.tsx @@ -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 (