Invalidate cached images when album changes

This commit is contained in:
Deluan
2021-03-12 15:39:31 -05:00
parent 0049d8d311
commit 1ec105a245
4 changed files with 25 additions and 18 deletions
+16 -1
View File
@@ -32,4 +32,19 @@ const unstar = (id) => fetchUtils.fetchJson(url('unstar', id))
const download = (id) => (window.location.href = url('download', id))
export default { url, scrobble, download, star, unstar }
const getCoverArtUrl = (record, size) => {
const options = {
...(record.updatedAt && { _: record.updatedAt }),
...(size && { size }),
}
return url('getCoverArt', record.coverArtId || 'not_found', options)
}
export default {
url,
getCoverArtUrl: getCoverArtUrl,
scrobble,
download,
star,
unstar,
}