From 7472e315453733e5e0e242216355a2872dd47e5a Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Sun, 29 Mar 2026 16:11:30 -0400 Subject: [PATCH] fix: always write artist row in index to prevent redundant re-indexing indexOneArtist only wrote the artist entry when aliases were non-empty. Artists without MB aliases (common for smaller/niche artists) never got an entity_type='artist' row, so indexedArtistMBIDs() couldn't see them. filterUnindexed then treated them as new on every startup, triggering redundant LB API calls for top-release-groups and top-recordings. Now the artist row is always written, with aliases as an empty string when none exist. Subsequent builds will correctly skip these artists. --- backend/explore/searchindex.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/backend/explore/searchindex.go b/backend/explore/searchindex.go index 8604ed5..32ffa1c 100644 --- a/backend/explore/searchindex.go +++ b/backend/explore/searchindex.go @@ -1195,21 +1195,21 @@ func (si *SearchIndex) indexOneArtist( wg.Wait() - // Extract aliases from the now-cached MB rels (populated by - // the image resolution above) and update the artist's index entry. + // Write the artist entry into the index so indexedArtistMBIDs() + // recognises this artist as processed on subsequent builds. + // Also stores aliases from the now-cached MB rels (populated + // by the image resolution above) for FTS search. if si.artistImg != nil { aliases := si.artistImg.GetAliases(artist.ArtistMBID) - if aliases != "" { - si.writeBatch([]SearchIndexResult{{ - EntityType: "artist", - MBID: artist.ArtistMBID, - Title: artist.ArtistName, - ArtistName: artist.ArtistName, - ArtistMBID: artist.ArtistMBID, - Popularity: artist.ListenCount, - Aliases: aliases, - }}) - } + si.writeBatch([]SearchIndexResult{{ + EntityType: "artist", + MBID: artist.ArtistMBID, + Title: artist.ArtistName, + ArtistName: artist.ArtistName, + ArtistMBID: artist.ArtistMBID, + Popularity: artist.ListenCount, + Aliases: aliases, + }}) } // Batch write discography results.