From 65d9fb0297c198c1481020251bb8f667f6190090 Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Mon, 30 Mar 2026 19:35:39 -0400 Subject: [PATCH] feat: album art fallback for artist grid view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Artists without dedicated images (from fanart.tv, TheAudioDB, Wikidata, etc) now fall back to their most popular album's cover art in the library artist grid. Uses the appropriate size tier based on device pixel ratio — CoverArtSmall for small avatars, CoverArtMedium/Large for larger ones. Only letter-initial placeholder remains as the absolute last resort. --- .../components/artists-view/artists-view.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/frontend/src/components/artists-view/artists-view.ts b/frontend/src/components/artists-view/artists-view.ts index cacbb92..d3946a4 100644 --- a/frontend/src/components/artists-view/artists-view.ts +++ b/frontend/src/components/artists-view/artists-view.ts @@ -18,6 +18,7 @@ import { } from '@go/library/Library'; import { library } from '@go/models'; import { LibraryController } from '@store/controllers/library-controller'; +import { libraryStore } from '@store/library-store'; import { SearchController } from '@store/controllers/search-controller'; import { queueStore } from '@store/queue-store'; import { @@ -995,6 +996,26 @@ export class ArtistsView imageURL = artist.ImageLarge || ''; } + // Fallback: use album cover art if no artist image. + if (!imageURL) { + const cachedAlbums = libraryStore.cachedAlbums; + if (cachedAlbums) { + const name = artist.Name.toLowerCase(); + + for (const a of cachedAlbums) { + if (a.ArtistName.toLowerCase() === name) { + if (needed <= 100) { + imageURL = a.CoverArtSmall || a.CoverArtMedium || ''; + } else { + imageURL = a.CoverArtMedium || a.CoverArtLarge || ''; + } + + if (imageURL) break; + } + } + } + } + if (imageURL) { return html`