fix(library): parallelize cover processing and retry missing artwork
ci / api / api (push) Successful in 50s
ci / db / db (push) Successful in 1m1s

This commit is contained in:
mrleo1nid committed 2026-10-23 02:02:36 +03:00
1 parent eed7038109
commit 0a4cd4bff1
5 files changed
+259 -28

No files matched your search

+5 -6
View File
@@ -195,12 +195,6 @@ func (sc *Scanner) run(ctx context.Context, src Source, root string, full bool)
return fmt.Errorf("library: patterns: %w", err)
}
if full {
// Полный скан — повод поискать обложки заново: в папках могли появиться cover.jpg.
if err := sc.store.ResetCoverChecks(ctx, src.ID); err != nil {
return err
}
}
existing, err := sc.store.Files(ctx, src.ID)
if err != nil {
return err
@@ -299,6 +293,11 @@ func (sc *Scanner) run(ctx context.Context, src Source, root string, full bool)
if err := sc.store.CleanupOrphans(ctx); err != nil {
return err
}
// Folder images can appear without changes to the audio files. A regular scan
// retries missing covers without forcing tags to be read again.
if err := sc.store.ResetCoverChecks(ctx, src.ID); err != nil {
return err
}
return sc.store.SetLastScan(ctx, src.ID, sc.now())
}