[navidrome]: prefer gerArtistInfo higher quality image

This commit is contained in:
Kendall Garner 2024-04-06 21:36:30 -07:00
parent 6824a5db7a
commit 2257e439a4
No known key found for this signature in database
GPG key ID: 18D2767419676C87

View file

@ -151,20 +151,18 @@ const getAlbumArtistDetail = async (
throw new Error('Server is required'); throw new Error('Server is required');
} }
// Prefer images from getArtistInfo first (which should be proxied)
// Prioritize large > medium > small
return ndNormalize.albumArtist( return ndNormalize.albumArtist(
{ {
...res.body.data, ...res.body.data,
...(artistInfoRes.status === 200 && { ...(artistInfoRes.status === 200 && {
largeImageUrl:
artistInfoRes.body.artistInfo.largeImageUrl ||
artistInfoRes.body.artistInfo.mediumImageUrl ||
artistInfoRes.body.artistInfo.smallImageUrl ||
res.body.data.largeImageUrl,
similarArtists: artistInfoRes.body.artistInfo.similarArtist, similarArtists: artistInfoRes.body.artistInfo.similarArtist,
...(!res.body.data.largeImageUrl && {
largeImageUrl: artistInfoRes.body.artistInfo.largeImageUrl,
}),
...(!res.body.data.mediumImageUrl && {
largeImageUrl: artistInfoRes.body.artistInfo.mediumImageUrl,
}),
...(!res.body.data.smallImageUrl && {
largeImageUrl: artistInfoRes.body.artistInfo.smallImageUrl,
}),
}), }),
}, },
apiClientProps.server, apiClientProps.server,