Build one sync plan for dry-run reporting and real execution #49
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
sync_playlists separately implements item-list construction, missing-track collection, counters, and change detection in dry-run and normal execution. Policy changes therefore need to be made twice.
Meanwhile _resolve_tracks performs persistent beets writes during what appears to be a calculation phase, making the boundary between planning and mutation difficult to audit.
Proposed change
Introduce a small, explicit desired-operation representation computed once. Dry-run renders that plan; execution applies it. Keep the abstraction proportionate to this plugin rather than introducing a general workflow framework.
Acceptance criteria
References:
beetsplug/appleplaylists/sync.py:26-47,sync.py:141-202. Audit finding 8 (maintainability). Related to batch matching and state transaction improvements, but focuses on shared planning/execution structure.