perf: lightweight post-scan indexing — only index new artists
After a library scan completes, OnAllScansComplete now calls IndexNewArtists() instead of StartIndexBuild(). This skips the full tier pipeline (sitewide top artists, similar artists, freshness checks) and only indexes library artists whose MBIDs are not yet in the search index. Flow after scan: 1. Query indexed artist MBIDs (fast, in-memory set) 2. Query library artist MBIDs 3. Diff → only new artists 4. Fetch discographies + images for new artists only The full StartIndexBuild() still runs on initial launch (when SoftScanAllLibraries finds no work to do) to handle the tier pipeline with freshness-based refresh. But adding 5 new albums to your library no longer triggers a 60-minute index rebuild.
This commit is contained in:
@@ -72,6 +72,12 @@ func (e *Service) StartIndexBuild() {
|
||||
e.index.StartBuild(e.ctx)
|
||||
}
|
||||
|
||||
// IndexNewArtists indexes only library artists not yet in the search
|
||||
// index. Lightweight post-scan path — skips the full tier machinery.
|
||||
func (e *Service) IndexNewArtists() {
|
||||
e.index.IndexNewArtists(e.ctx)
|
||||
}
|
||||
|
||||
// StopIndexBuild cancels the background search index build.
|
||||
// Call before a full rescan to free the DB for the scan.
|
||||
func (e *Service) StopIndexBuild() {
|
||||
|
||||
Reference in New Issue
Block a user