mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Load artwork from embedded
This commit is contained in:
parent
c36e77d41f
commit
7b87386089
8 changed files with 143 additions and 37 deletions
|
@ -37,7 +37,7 @@ const mapToAudioLists = (item) => {
|
|||
musicSrc: subsonic.streamUrl(trackId),
|
||||
cover: subsonic.getCoverArtUrl(
|
||||
{
|
||||
coverArtId: config.devFastAccessCoverArt ? item.albumId : trackId,
|
||||
id: config.devFastAccessCoverArt ? item.albumId : trackId,
|
||||
updatedAt: item.updatedAt,
|
||||
},
|
||||
300
|
||||
|
|
|
@ -51,10 +51,14 @@ const getCoverArtUrl = (record, size) => {
|
|||
...(size && { size }),
|
||||
}
|
||||
|
||||
if (record.coverArtId) {
|
||||
return baseUrl(url('getCoverArt', record.coverArtId, options))
|
||||
const lastUpdate = Math.floor(Date.parse(record.updatedAt) / 1000).toString(
|
||||
16
|
||||
)
|
||||
const id = record.id + '-' + lastUpdate
|
||||
if (record.album) {
|
||||
return baseUrl(url('getCoverArt', 'mf-' + id, options))
|
||||
} else {
|
||||
return baseUrl(url('getCoverArt', 'not_found', size && { size }))
|
||||
return baseUrl(url('getCoverArt', 'al-' + id, options))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue