fix: suppress all external API calls in library-only mode

Audit found three leaks:

1. explore-view: loadThumbnails() and loadArtistImages() fired on
   library search results. These call GetThumbnails (Wails RPC to
   Cover Art Archive proxy) and GetArtistImageURL (MB/Wikidata).
   Now skipped in library-only mode — library results already have
   local cover art and artist images from the library store.

2. explore-album-details: always called LookupReleaseGroup (MB) and
   BrowseReleases (MB) regardless of mode. Now skips both in
   library-only mode — shows only cache-hydrated header with no
   version selector or track listing.

3. explore-artist-details was already correct — the library-only
   branch skips all external calls.
This commit is contained in:
2026-03-30 16:09:29 -04:00
parent 4e52f6b494
commit 1103d6f818
2 changed files with 14 additions and 2 deletions
@@ -426,6 +426,14 @@ export class ExploreAlbumDetails extends LitElement {
console.log(`[explore-album] hydrated from cache: "${cached.title}"`);
}
// Library-only mode: no external API calls.
if (exploreSettings.libraryOnly) {
this.loadingInfo = false;
this.loadingReleases = false;
console.log(`[explore-album] loaded (library-only): "${this.albumName}"`);
return;
}
// Phase 1: API calls for full data.
const [infoResult, releasesResult] = await Promise.allSettled([
this.fetchReleaseGroup(mbid),
@@ -597,8 +597,12 @@ export class ExploreView extends LitElement {
localResults.artists || [],
localResults.releaseGroups || [],
);
this.loadThumbnails();
this.loadArtistImages();
// In library-only mode, local results already have cover art
// and artist images from the library store — no API calls needed.
if (!exploreSettings.libraryOnly) {
this.loadThumbnails();
this.loadArtistImages();
}
const elapsed = (performance.now() - startTime).toFixed(0);
console.log(
`[explore] library results: "${query}" in ${elapsed}ms — ` +