Batch playlist membership and resolution updates in one state transaction #45
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 commits membership replacement and then calls
set_resolution_stateseparately for every track occurrence. Each call starts its own transaction and changes updated_at, including duplicate occurrences and unchanged resolution values.This causes unnecessary commits and leaves a playlist's state memberships and resolutions partially updated after a later failure within the same plugin database. Cross-store partial completion is expected by the spec; this additional fragmentation within one store is avoidable.
Proposed change
Provide a focused state-store operation that saves one playlist's memberships and unique-track resolution decisions together. Avoid redundant resolution updates while preserving Apple descriptor refresh and permanent skips.
Acceptance criteria
References:
beetsplug/appleplaylists/sync.py:177-191,state.py:127-161,state.py:228-255. Audit finding 4 (medium).