feat(ui): add playlist cover art display

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-05-25 23:22:55 -04:00
parent 0cb02bce06
commit 5c4fbdb7c1
3 changed files with 245 additions and 31 deletions
+9
View File
@@ -61,11 +61,20 @@ const getCoverArtUrl = (record, size, square) => {
...(square && { square }),
}
// For playlists, add a timestamp to prevent caching issues when switching between playlists
if (record.songCount !== undefined) {
// Add current timestamp to ensure fresh requests for playlists
options._ = record.updatedAt || new Date().getTime()
}
// TODO Move this logic to server. `song` and `album` should have a CoverArtID
if (record.album) {
return baseUrl(url('getCoverArt', 'mf-' + record.id, options))
} else if (record.albumArtist) {
return baseUrl(url('getCoverArt', 'al-' + record.id, options))
} else if (record.songCount !== undefined) {
// This is a playlist
return baseUrl(url('getCoverArt', 'pl-' + record.id, options))
} else {
return baseUrl(url('getCoverArt', 'ar-' + record.id, options))
}