Stop warning about slave-only content in layout checks
A singles library naturally has artists and songs the albums library lacks, so "only N of M top-level folders exist in the master" and "N of M slave files have no counterpart" were false alarms. Layout warnings now only flag real layout problems: - Folders that are the same but named differently (case, punctuation, accents, "&"/"and", leading/trailing "The"), at the top level and one level down inside shared folders, with examples. - Songs found in both libraries that mostly live in a different folder in the master (e.g. Artist/Song vs Artist/Album/Song). Slave-only songs are ignored, as are singles/EPs/compilations matched to their album version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e8c534a3ae
commit
0ae4e85bd2
4 files changed
+269
-37
No files matched your search
@@ -314,7 +314,7 @@ func (e *Engine) scan(ctx context.Context, j *Job, pairID int64, trigger string)
|
||||
|
||||
j.phase("Comparing files", int64(len(slaveFiles)))
|
||||
keep := map[string]bool{}
|
||||
kinds := map[string]int{}
|
||||
var layout layoutStats
|
||||
for _, rel := range sortedKeys(slaveFiles) {
|
||||
if ctx.Err() != nil {
|
||||
return ctx.Err()
|
||||
@@ -331,7 +331,7 @@ func (e *Engine) scan(ctx context.Context, j *Job, pairID int64, trigger string)
|
||||
return err
|
||||
}
|
||||
keep[rel] = true
|
||||
kinds[m.Kind]++
|
||||
layout.add(m.RelSlave, m.RelMaster, m.Kind, m.Reason)
|
||||
j.count(m.Status)
|
||||
j.tick()
|
||||
}
|
||||
@@ -340,11 +340,8 @@ func (e *Engine) scan(ctx context.Context, j *Job, pairID int64, trigger string)
|
||||
}
|
||||
|
||||
// Layout warnings based on what was actually found.
|
||||
if ss.files > 0 {
|
||||
if n := kinds[store.KindElsewhere] + kinds[store.KindApprox] + kinds[store.KindNone]; n*4 > ss.files {
|
||||
warns = append(warns, fmt.Sprintf("%d of %d slave files have no counterpart at the same path in the master library. "+
|
||||
"Check that both libraries use the same folder layout.", n, ss.files))
|
||||
}
|
||||
if w := layout.warning(); w != "" {
|
||||
warns = append(warns, w)
|
||||
}
|
||||
if ms.symlinks+ss.symlinks > 0 {
|
||||
warns = append(warns, fmt.Sprintf("Ignored %d symlinks (playlink never follows or replaces symlinks).", ms.symlinks+ss.symlinks))
|
||||
|
||||
Reference in new issue
Block a user