perf: batch thumbnail loading — one Wails call for all album art

Replace per-card GetThumbnail calls (10 round-trips) with a single
GetThumbnails batch call that fetches all visible album thumbnails
in one Wails bridge round-trip.

Backend GetThumbnails accepts []ThumbnailRequest and returns
map[mbid]→dataURL. Each request still checks library → disk cache
→ CAA in order, but the bridge overhead is 1 call instead of 10.

Frontend fires loadThumbnails() once after search results arrive.
Album cards render immediately with CAA URL fallback, then re-render
once the batch resolves with cached/local data URLs.
This commit is contained in:
2026-03-25 19:37:46 -04:00
parent 0761cff408
commit 0e376abfbb
4 changed files with 96 additions and 18 deletions
+8
View File
@@ -13,6 +13,14 @@ export function CoverArtURL(arg1:string):Promise<string>;
export function GetThumbnail(arg1:string, arg2:string, arg3:string):Promise<string>;
export interface ThumbnailRequest {
mbid: string;
albumName: string;
artistName: string;
}
export function GetThumbnails(arg1:ThumbnailRequest[]):Promise<Record<string, string>>;
export function LookupArtist(arg1:string):Promise<explore.MBArtist>;
export function LookupReleaseGroup(arg1:string):Promise<explore.MBReleaseGroup>;
+4
View File
@@ -22,6 +22,10 @@ export function GetThumbnail(arg1, arg2, arg3) {
return window['go']['explore']['Service']['GetThumbnail'](arg1, arg2, arg3);
}
export function GetThumbnails(arg1) {
return window['go']['explore']['Service']['GetThumbnails'](arg1);
}
export function LookupArtist(arg1) {
return window['go']['explore']['Service']['LookupArtist'](arg1);
}