feat(ui): add playlist cover art display
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user