feat: MBIDs in library models + local-first search + explore cache

Backend:
- Added mbid column to sqlc schemas for artists and release_groups
- Regenerated sqlc queries to SELECT mbid in artist/album queries
- Added MBID field to library.Artist and library.Album Go structs
- All GetAllArtists/GetAllAlbums variants now populate MBID

Frontend:
- Updated Wails models.ts with MBID fields on Artist and Album
- Added cachedArtists/cachedAlbums getters to LibraryStore
- searchLibraryCache now includes MBIDs and local cover art URLs
  so library results can navigate to explore detail pages
- Added mergeWithLibrary() — when full MB results arrive, library
  entries are enriched with local images and 'In Library' flags
  rather than being replaced by MB-only versions
- Created ExploreCache store for cross-page data sharing: search
  results populate the cache, detail pages can read from it to
  avoid redundant API calls for already-fetched data
This commit is contained in:
2026-03-29 18:54:22 -04:00
parent 1999fdb0f4
commit 8096b28d17
13 changed files with 255 additions and 41 deletions
-3
View File
@@ -1,7 +1,6 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {explore} from '../models';
import {http} from '../models';
import {context} from '../models';
export function BrowseReleaseGroups(arg1:string):Promise<Array<explore.MBReleaseGroup>>;
@@ -38,8 +37,6 @@ export function SearchArtists(arg1:string):Promise<Array<explore.MBArtist>>;
export function SearchLocal(arg1:string):Promise<explore.MBSearchResult>;
export function SearchLocalHandler():Promise<http.Handler>;
export function SearchRecordings(arg1:string):Promise<Array<explore.MBRecording>>;
export function SearchReleaseGroups(arg1:string):Promise<Array<explore.MBReleaseGroup>>;
-4
View File
@@ -70,10 +70,6 @@ export function SearchLocal(arg1) {
return window['go']['explore']['Service']['SearchLocal'](arg1);
}
export function SearchLocalHandler() {
return window['go']['explore']['Service']['SearchLocalHandler']();
}
export function SearchRecordings(arg1) {
return window['go']['explore']['Service']['SearchRecordings'](arg1);
}
+4
View File
@@ -242,6 +242,7 @@ export namespace library {
ID: number;
Name: string;
ArtistName: string;
MBID: string;
CoverArtPath: string;
CoverArtSmall: string;
CoverArtMedium: string;
@@ -257,6 +258,7 @@ export namespace library {
this.ID = source["ID"];
this.Name = source["Name"];
this.ArtistName = source["ArtistName"];
this.MBID = source["MBID"];
this.CoverArtPath = source["CoverArtPath"];
this.CoverArtSmall = source["CoverArtSmall"];
this.CoverArtMedium = source["CoverArtMedium"];
@@ -267,6 +269,7 @@ export namespace library {
export class Artist {
ID: number;
Name: string;
MBID: string;
ImageSmall: string;
ImageMedium: string;
ImageLarge: string;
@@ -279,6 +282,7 @@ export namespace library {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.Name = source["Name"];
this.MBID = source["MBID"];
this.ImageSmall = source["ImageSmall"];
this.ImageMedium = source["ImageMedium"];
this.ImageLarge = source["ImageLarge"];