fix(library): parallelize cover processing and retry missing artwork
This commit is contained in:
1 parent
eed7038109
commit
0a4cd4bff1
5 files changed
+259
-28
No files matched your search
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user