fix: stop invalidating discography cache after every library scan
Root cause: OnAllScansComplete called InvalidateIndexDiscographies() which deleted the discog_built timestamp. SoftScanAllLibraries triggers a scan whenever file counts differ (even by 1 file), so on most launches the hook fired and wiped the cache. The invalidation was unnecessary — Tiers 2-4 are already incremental. filterUnindexed skips artists that are already indexed, so new library artists with freshly-populated MBIDs get picked up naturally without forcing a full rebuild. InvalidateIndexDiscographies is kept as a public API for manual rebuild (future UI button) but no longer called automatically. Combined with per-tier timestamps from the previous commit, the index build now correctly skips completed tiers on restart.
This commit is contained in:
+6
-3
@@ -232,9 +232,12 @@ func (yj *YellowJacketApp) OnStartup(ctx context.Context) {
|
|||||||
yj.library.SetScanHooks(library.ScanHooks{
|
yj.library.SetScanHooks(library.ScanHooks{
|
||||||
ResolvePhantoms: yj.playlist.ResolvePhantomTracksAfterScan,
|
ResolvePhantoms: yj.playlist.ResolvePhantomTracksAfterScan,
|
||||||
OnAllScansComplete: func() {
|
OnAllScansComplete: func() {
|
||||||
// Force index Tiers 2-4 to re-check for new library
|
// Start the index build after scans finish.
|
||||||
// artists whose MBIDs were just populated by the scan.
|
// Tiers 2-4 are incremental — filterUnindexed
|
||||||
yj.explore.InvalidateIndexDiscographies()
|
// already skips artists that are already indexed,
|
||||||
|
// so new library artists with freshly-populated
|
||||||
|
// MBIDs get picked up without invalidating the
|
||||||
|
// entire discography cache.
|
||||||
yj.explore.StartIndexBuild()
|
yj.explore.StartIndexBuild()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user