fix(library): hidden files and folders are not part of the library (#8305)
A full scan, the watcher's directory watches and the files it queues all skip any name below a library root that starts with a dot. A download manager can park replaced copies in a hidden folder, and macOS leaves "._" files beside the music; neither is a track. A track already indexed from a hidden path is marked missing at the next full scan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -296,6 +296,12 @@ func (s *Scanner) enumerate(
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if path != root && hiddenName(d.Name()) {
|
||||
if d.IsDir() {
|
||||
return fs.SkipDir
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if d.IsDir() {
|
||||
return nil
|
||||
}
|
||||
@@ -576,11 +582,12 @@ func (s *Scanner) ScanFiles(ctx context.Context, paths []string) ([]pgtype.UUID,
|
||||
seen := make(map[[16]byte]struct{})
|
||||
changed := make([]pgtype.UUID, 0)
|
||||
var stats Stats
|
||||
roots := s.Roots()
|
||||
for _, path := range paths {
|
||||
if ctx.Err() != nil {
|
||||
return changed, ctx.Err()
|
||||
}
|
||||
if !audioExtensions[strings.ToLower(filepath.Ext(path))] {
|
||||
if !audioExtensions[strings.ToLower(filepath.Ext(path))] || hiddenInLibrary(roots, path) {
|
||||
continue
|
||||
}
|
||||
albumID, didChange, err := s.scanFile(ctx, q, path, &stats)
|
||||
|
||||
Reference in New Issue
Block a user