feat: multi-source artist images with thumbnails + grid integration

Complete rewrite of the artist image pipeline:

STORAGE:
- Migration 16: artist_images table tracking source, URL, path,
  primary flag, dimensions per image (up to 10 per artist)
- Directory structure: artist-images/{mbid[:2]}/{mbid}/ with
  primary.jpg + primary_sm.jpg/_md.jpg/_lg.jpg thumbnails
- Miss marker (.miss file) prevents re-fetching artists with no image

SOURCES (priority order):
1. MusicBrainz direct image relations (Wikimedia Commons)
2. Wikidata P18 property (Wikimedia Commons)
3. Wikipedia lead image (NEW — via Wikidata sitelinks → Wikipedia API)

Each source is checked, deduplicated, and the first available
image becomes the primary with sm/md/lg thumbnail generation
(100px/200px/400px, matching cover art tier sizes).

ASSET SERVING:
- /artist-images/ path registered with Wails asset handler
- Serves files via http.FileServer from the artist-images directory
- Same pattern as /covers/ for cover art

ARTIST MODEL:
- Artist struct gains ImageSmall/ImageMedium/ImageLarge fields
- resolveArtistImages does bulk MBID lookup → disk stat for each
- Populated in GetAllArtists and GetAllArtistsByLibrary

GRID VIEW:
- artists-view uses model URLs directly (no more base64 data URLs)
- Size selection based on imageSize * devicePixelRatio (like cover-grid)
- Removed batch GetArtistImages call and in-memory cache — no longer needed
This commit is contained in:
2026-03-29 08:33:32 -04:00
parent 7ec9785463
commit 19a803d1fc
10 changed files with 668 additions and 317 deletions
+2 -2
View File
@@ -15,6 +15,8 @@ export function CoverArtURL(arg1:string):Promise<string>;
export function GetArtistImageURL(arg1:string):Promise<string>;
export function GetArtistImages(arg1:Array<string>):Promise<Record<string, string>>;
export function GetArtistMBID(arg1:string):Promise<string>;
export function GetThumbnail(arg1:string,arg2:string,arg3:string):Promise<string>;
@@ -44,5 +46,3 @@ export function StartIndexBuild():Promise<void>;
export function StopIndexBuild():Promise<void>;
export function TopRecordingsForArtist(arg1:string):Promise<Array<explore.LBTopRecording>>;
export function GetArtistImages(arg1:string[]):Promise<Record<string, string>>;
+4 -4
View File
@@ -26,6 +26,10 @@ export function GetArtistImageURL(arg1) {
return window['go']['explore']['Service']['GetArtistImageURL'](arg1);
}
export function GetArtistImages(arg1) {
return window['go']['explore']['Service']['GetArtistImages'](arg1);
}
export function GetArtistMBID(arg1) {
return window['go']['explore']['Service']['GetArtistMBID'](arg1);
}
@@ -85,7 +89,3 @@ export function StopIndexBuild() {
export function TopRecordingsForArtist(arg1) {
return window['go']['explore']['Service']['TopRecordingsForArtist'](arg1);
}
export function GetArtistImages(arg1) {
return window['go']['explore']['Service']['GetArtistImages'](arg1);
}
+2 -8
View File
@@ -46,6 +46,8 @@ export function GetRemovalImpact(arg1:number):Promise<library.RemovalImpact>;
export function GetScanQueueLength():Promise<number>;
export function GetTrackMBIDs(arg1:string):Promise<library.TrackMBIDs>;
export function GetTracksByGenre(arg1:string):Promise<Array<library.Track>>;
export function GetTracksByGenreByLibrary(arg1:string,arg2:number):Promise<Array<library.Track>>;
@@ -83,11 +85,3 @@ export function SetRescanHooks(arg1:library.RescanHooks):Promise<void>;
export function SetScanHooks(arg1:library.ScanHooks):Promise<void>;
export function SoftScanAllLibraries():Promise<void>;
export interface TrackMBIDs {
recordingMbid: string;
releaseGroupMbid: string;
artistMbid: string;
}
export function GetTrackMBIDs(arg1:string):Promise<TrackMBIDs>;
+4 -4
View File
@@ -86,6 +86,10 @@ export function GetScanQueueLength() {
return window['go']['library']['Library']['GetScanQueueLength']();
}
export function GetTrackMBIDs(arg1) {
return window['go']['library']['Library']['GetTrackMBIDs'](arg1);
}
export function GetTracksByGenre(arg1) {
return window['go']['library']['Library']['GetTracksByGenre'](arg1);
}
@@ -161,7 +165,3 @@ export function SetScanHooks(arg1) {
export function SoftScanAllLibraries() {
return window['go']['library']['Library']['SoftScanAllLibraries']();
}
export function GetTrackMBIDs(arg1) {
return window['go']['library']['Library']['GetTrackMBIDs'](arg1);
}
+28
View File
@@ -247,6 +247,9 @@ export namespace library {
export class Artist {
ID: number;
Name: string;
ImageSmall: string;
ImageMedium: string;
ImageLarge: string;
static createFrom(source: any = {}) {
return new Artist(source);
@@ -256,6 +259,9 @@ export namespace library {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.Name = source["Name"];
this.ImageSmall = source["ImageSmall"];
this.ImageMedium = source["ImageMedium"];
this.ImageLarge = source["ImageLarge"];
}
}
export class GenreWithCount {
@@ -486,6 +492,9 @@ export namespace library {
FileSize: number;
PlayCount: number;
LastPlayed: string;
RecordingMBID: string;
ArtistMBID: string;
ReleaseGroupMBID: string;
static createFrom(source: any = {}) {
return new Track(source);
@@ -511,6 +520,25 @@ export namespace library {
this.FileSize = source["FileSize"];
this.PlayCount = source["PlayCount"];
this.LastPlayed = source["LastPlayed"];
this.RecordingMBID = source["RecordingMBID"];
this.ArtistMBID = source["ArtistMBID"];
this.ReleaseGroupMBID = source["ReleaseGroupMBID"];
}
}
export class TrackMBIDs {
recordingMbid: string;
releaseGroupMbid: string;
artistMbid: string;
static createFrom(source: any = {}) {
return new TrackMBIDs(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.recordingMbid = source["recordingMbid"];
this.releaseGroupMbid = source["releaseGroupMbid"];
this.artistMbid = source["artistMbid"];
}
}