feat: artist image disk cache + fix top results artist photos
Two changes:
1. Artist image disk cache: ArtistImageProvider now fetches the
actual image bytes from Wikimedia Commons and caches them on
disk (~/.local/share/yellowjacket/artist-image-cache/{mbid}.jpg).
Returns base64 data URLs, same pattern as CoverArtProxy.
First lookup: resolve URL via MB/Wikidata + fetch image (~2s).
Subsequent: instant from disk cache.
404s cached as empty files to avoid re-fetching.
2. Top results artist photos: the Top Results section now shows
artist images from the artistImageCache, same as the Artists
section. Also shows englishName in the top card display name.
This commit is contained in:
@@ -866,6 +866,7 @@ export class ExploreView extends LitElement {
|
||||
if (item.type === 'artist' && item.artist) {
|
||||
const a = item.artist;
|
||||
const hue = nameToHue(a.name);
|
||||
const imgURL = this.artistImageCache.get(a.mbid);
|
||||
return html`
|
||||
<div
|
||||
class="top-card"
|
||||
@@ -883,10 +884,12 @@ export class ExploreView extends LitElement {
|
||||
class="artist-avatar"
|
||||
style="background: hsl(${hue}, 45%, 35%)"
|
||||
>
|
||||
${(a.englishName || a.name).charAt(0).toUpperCase()}
|
||||
${imgURL
|
||||
? html`<img src="${imgURL}" alt="${a.englishName || a.name}" />`
|
||||
: (a.englishName || a.name).charAt(0).toUpperCase()}
|
||||
</div>
|
||||
<div class="top-card-info">
|
||||
<div class="top-card-name">${a.name}</div>
|
||||
<div class="top-card-name">${a.englishName || a.name}</div>
|
||||
<div class="top-card-meta">Artist${a.country ? ` · ${a.country}` : ''}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user