From d0e2a798fe38af592374b08a60a51b5f80f89081 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sun, 1 Jan 2023 15:05:26 -0800 Subject: [PATCH] Account for playlist items in cover art url --- src/renderer/api/navidrome.api.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/renderer/api/navidrome.api.ts b/src/renderer/api/navidrome.api.ts index f86ccf06..ae813fa5 100644 --- a/src/renderer/api/navidrome.api.ts +++ b/src/renderer/api/navidrome.api.ts @@ -450,20 +450,6 @@ const normalizeSong = ( deviceId: string, imageSize?: number, ): Song => { - const imageUrl = getCoverArtUrl({ - baseUrl: server.url, - coverArtId: item.id, - credential: server.credential, - size: imageSize || 300, - }); - - const imagePlaceholderUrl = getCoverArtUrl({ - baseUrl: server.url, - coverArtId: item.albumId, - credential: server.credential, - size: 1, - }); - let id; // Dynamically determine the id field based on whether or not the item is a playlist song @@ -473,6 +459,20 @@ const normalizeSong = ( id = item.id; } + const imageUrl = getCoverArtUrl({ + baseUrl: server.url, + coverArtId: id, + credential: server.credential, + size: imageSize || 300, + }); + + const imagePlaceholderUrl = getCoverArtUrl({ + baseUrl: server.url, + coverArtId: id, + credential: server.credential, + size: 1, + }); + return { album: item.album, albumArtists: [{ id: item.artistId, name: item.artist }],