feat: artist images from MusicBrainz/Wikidata/Wikimedia Commons

Add ArtistImageProvider that resolves artist MBIDs to photo URLs:
1. MB url-rels 'image' type → extract Commons filename → thumb URL
2. MB url-rels 'wikidata' type → Wikidata P18 property → thumb URL
3. No image → falls back to initial-letter avatar

Wikimedia Commons thumb URLs constructed via MD5 hash bucketing
(standard Commons URL scheme). Results cached in explore_cache
with 30-day TTL — subsequent lookups are instant.

Frontend: search results and artist detail page show artist photos
in the circular avatar when available. Images load async and
replace the initial-letter fallback on arrival. Artist detail page
fires the image fetch alongside the other 4 parallel data loads.

Architecture supports adding more sources (fanart.tv, etc.) by
extending the resolve() method's source chain.
This commit is contained in:
2026-03-25 19:55:10 -04:00
parent 0e376abfbb
commit 55473dd52a
6 changed files with 432 additions and 25 deletions
Vendored Executable → Regular
+4 -7
View File
@@ -11,15 +11,11 @@ export function CoverArtGroupURL(arg1:string):Promise<string>;
export function CoverArtURL(arg1:string):Promise<string>;
export function GetThumbnail(arg1:string, arg2:string, arg3:string):Promise<string>;
export function GetArtistImageURL(arg1:string):Promise<string>;
export interface ThumbnailRequest {
mbid: string;
albumName: string;
artistName: string;
}
export function GetThumbnail(arg1:string,arg2:string,arg3:string):Promise<string>;
export function GetThumbnails(arg1:ThumbnailRequest[]):Promise<Record<string, string>>;
export function GetThumbnails(arg1:Array<explore.ThumbnailRequest>):Promise<Record<string, string>>;
export function LookupArtist(arg1:string):Promise<explore.MBArtist>;
@@ -38,3 +34,4 @@ export function SetContext(arg1:context.Context):Promise<void>;
export function SimilarArtists(arg1:string):Promise<Array<explore.LBSimilarArtist>>;
export function TopRecordingsForArtist(arg1:string):Promise<Array<explore.LBTopRecording>>;
+4
View File
@@ -18,6 +18,10 @@ export function CoverArtURL(arg1) {
return window['go']['explore']['Service']['CoverArtURL'](arg1);
}
export function GetArtistImageURL(arg1) {
return window['go']['explore']['Service']['GetArtistImageURL'](arg1);
}
export function GetThumbnail(arg1, arg2, arg3) {
return window['go']['explore']['Service']['GetThumbnail'](arg1, arg2, arg3);
}