Account for playlist items in cover art url

This commit is contained in:
jeffvli 2023-01-01 15:05:26 -08:00
parent fecaa2e6b8
commit d0e2a798fe

View File

@ -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 }],