Skip to content

fix(locallibrary): move every row's entries when replacing a shared file's track - #452

Merged
botandbang merged 1 commit into
mainfrom
bnb/replace-track-entries
Nov 5, 2026
Merged

botandbang merged 1 commit into
mainfrom
bnb/replace-track-entries

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

Replacing a track deletes every row of the duplicate's audio file, but the repoint operation before it moved the playlist and history entries of only one of those rows. When a second row of the file sat in a list (rekordbox's own export can do this), its entries were lost with the delete.

Changed

  • Op::Repoint moves the entries of every row of the file it names to the kept track, in export.pdb, exportLibrary.db and the model.

Added

  • A Hegel property on the model that draws which entries each list holds, and which row of a shared file is named as the duplicate.
  • An integration test that replaces a duplicate whose file a second row in a history list shares, checking both databases.
  • A changelog fragment.

Removed

Nothing.

…ile's track

Op::Repoint moved the playlist and history entries of one row of the duplicate's file, but
replacing a track deletes every row of that file, so the other rows' entries went with them.
@botandbang
botandbang requested a review from bnb as a code owner November 5, 2026 15:16
@github-actions github-actions Bot added documentation Improvements or additions to documentation locallibrary locallibrary and the loclib-* crates locallibrary: core The core crate, the data model and rekordbox's formats tests Tests, fixtures and test harnesses labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Rust coverage

From run 356. Both are held to the thresholds in .cargo/config.toml.

Tests Lines Functions Regions
All 97.65% (87909/90023) 97.05% (14299/14733) 96.04% (194301/202307)
Hegel property tests alone 96.09% (86507/90023) 95.38% (14053/14733) 94.36% (190900/202307)

@botandbang
botandbang added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit fa74c75 Nov 5, 2026
32 checks passed
@botandbang
botandbang deleted the bnb/replace-track-entries branch November 5, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation locallibrary: core The core crate, the data model and rekordbox's formats locallibrary locallibrary and the loclib-* crates tests Tests, fixtures and test harnesses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants