Skip empty tonie folders instead of pruning all chapters
Previously, an accidentally empty tonie folder combined with pruning
(the default) would delete every existing chapter on the tonie. Now:
- syncer.BuildPlan detects an empty local folder and returns a
Plan{Skipped: true, SkipReason: ...} instead of computing a diff
- syncer.ApplyPlan is a no-op for a skipped plan (defense in depth)
- Plan.NeedsChanges() reports false for skipped plans
- cmd/toni-sync sync prints "Skipped: <reason>" for such folders and
moves on, regardless of --no-prune
- Added a test covering the skip behavior end-to-end (BuildPlan +
ApplyPlan no-op)
- README documents the safety behavior
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -132,6 +132,10 @@ toni-sync sync --root ~/Musik/tonies --dry-run
|
||||
existieren (abschaltbar via `--no-prune`), und sortiert die Kapitel passend
|
||||
zur lokalen Reihenfolge (Playlist-Datei falls vorhanden, sonst alphabetisch).
|
||||
|
||||
**Leere Tonie-Ordner werden übersprungen** - so verhindert toni-sync, dass
|
||||
ein versehentlich leerer Ordner (z. B. noch nicht befüllt) beim Sync alle
|
||||
vorhandenen Kapitel auf dem Tonie löscht.
|
||||
|
||||
### Household-/Tonie-IDs nachschlagen
|
||||
|
||||
Falls du die Struktur lieber manuell pflegen willst:
|
||||
|
||||
Reference in New Issue
Block a user