fix(12-02): soft scan on launch — only scan libraries with changed file counts

SoftScanAllLibraries compares audio file count on disk vs DB track count
per library. Unchanged libraries are silently skipped (no progress bar,
no events). Only libraries where files were added or removed since the
last scan get queued for a full scan.
This commit is contained in:
2026-03-13 13:53:46 -04:00
parent 1d735c3a5f
commit 92c4d23a9a
2 changed files with 68 additions and 5 deletions
+5 -5
View File
@@ -275,12 +275,12 @@ func (yj *YellowJacketApp) OnDomReady(ctx context.Context) {
return
}
// Auto-scan all libraries on launch. Runs in a goroutine so
// it does not block the DOM-ready callback. Uses the same
// ScanAllLibraries codepath as the UI button.
// Soft scan: compare file counts on disk vs DB for each library.
// Only libraries with mismatched counts get a full scan — unchanged
// libraries are silently skipped (no progress bar, no UI noise).
go func() {
if err := yj.library.ScanAllLibraries(); err != nil {
yj.logger.Error("auto-scan failed", "err", err)
if err := yj.library.SoftScanAllLibraries(); err != nil {
yj.logger.Error("soft scan failed", "err", err)
}
}()
}