Improve performance of placeholder images (#1325)

* Don't include updatedAt field when fetching album art placeholder. This will allow browers to cache the place holder

* Apply resizing to placeholder image

* Fix issues discovered by CI linter and prettier

* Updates from PR review
This commit is contained in:
Tucker Kern
2021-09-06 20:34:37 -06:00
committed by GitHub
parent 173b30cd59
commit fb11080545
2 changed files with 19 additions and 4 deletions
+5 -1
View File
@@ -49,7 +49,11 @@ const getCoverArtUrl = (record, size) => {
...(record.updatedAt && { _: record.updatedAt }),
...(size && { size }),
}
return baseUrl(url('getCoverArt', record.coverArtId || 'not_found', options))
if (record.coverArtId) {
return baseUrl(url('getCoverArt', record.coverArtId, options))
} else {
return baseUrl(url('getCoverArt', 'not_found', size && { size }))
}
}
const streamUrl = (id) => {