Skip to content

feat(locallibrary): exportExt.pdb and intelligent playlists in collection export, parallel prep sync - #319

Merged
botandbang merged 3 commits into
mainfrom
bnb/collection-export
Oct 31, 2026
Merged

botandbang merged 3 commits into
mainfrom
bnb/collection-export

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

What and why

collection export now writes exportExt.pdb next to export.pdb, so players that read export.pdb (CDJ-3000 and older) get the collection's My Tags. A new exportExt.pdb is made from an emptied rekordbox template kept in the package (the vendored crate's MIT test file), filled with the collection's categories and tags under the ids OneLibrary gets, and its track links go through the same carry_into_ext writer convert and merge use, verification included.

Intelligent playlists are no longer left out. masterdb reads the SmartList rules (format as pyrekordbox documents it) and resolves My Tag ids. The export fills each intelligent playlist with the tracks its rules match. When a locallibrary filter can say the rules, the plan carries a smart rule for the drive, and applying the export with a store saves it limited to that drive, so smart apply keeps the playlist current. A later export takes away the rules of intelligent playlists that are gone, and never replaces a rule someone else made at the same path. Rules a filter can't say (artist, starts with, in the last N days, and a few fields filters lack) go out as the tracks they hold now, and the plan names them. Rules that can't be read stay behind, also named. A property test checks that every filter produced matches exactly what the rules match.

prep now copies the newest drive onto the others at once through the multi-drive sync when two or more need a copy and none came back from a set. A drive back from a set keeps its own pair sync, which saves the players' changes first. The multi-drive sync runs at most one target per core, through a new bounded worker helper that probe::parallel uses too.

A change planned against a store that store copy made (opened with --store) now warns first that the next store copy there will refuse it unless forced.

Changed: masterdb::tags_by_file is a free function, query::date_value is crate-visible, CollectionExportPlan has a smart field (RPC contract regenerated), and CollectionExportRecord has a smart field.

Removed: probe::parallel's own thread queue, and the TODO lines for these four items.

Fixes LOC-41
Fixes #141
Fixes LOC-63
Fixes #164
Refs LOC-40 (confirming My Tags in Track Filter on a CDJ-3000 is still to do)
Refs #140

How it was tested

  • cargo fmt --check, and cargo clippy -p locallibrary -p locallibrary-cli --all-targets -- -D warnings.
  • cargo nextest run -p locallibrary on the masterdb, smartlist, collection, tags, smart, probe, workers, sync, offsite, query, jobs, prep and copy tests: 381 pass. cargo nextest run -p locallibrary-cli on the store, collection, exports, rpc, command line, prep, players and output tests: 227 pass.
  • Each new test was broken once and failed: the export test with ext: None, the SmartList filter property with Compare::Is as >=, the prep test with pairwise work ("one sync onto both, left: 2 right: 1"), and the store test without the warning.
  • docs/rpc regenerated with cargo run -p locallibrary-cli -- rpc --emit-schema apps/locallibrary/docs/rpc.
  • Not run: a real CDJ, the full suite and Windows clippy.

Checklist

  • Tests cover the change
  • For locallibrary: apps/locallibrary/CHANGELOG.md has a line under Unreleased, if people using it will notice
  • The READMEs, docs/ and --help still say what the code does (apps/locallibrary/docs/rpc/ too, for a sidecar change)

…tion export, parallel prep

Planned as these commits, folded into one because they share files:

- feat(locallibrary): write exportExt.pdb on collection export
- feat(locallibrary): export rekordbox intelligent playlists with smart rules
- feat(locallibrary): copy onto prep's drives at once, bounded by core count
- feat(locallibrary-cli): warn before changing a store copy
@botandbang
botandbang requested a review from bnb as a code owner October 30, 2026 16:18
@linear-code

linear-code Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

LOC-40

LOC-63

LOC-41

bnb
bnb previously approved these changes Oct 30, 2026
@botandbang
botandbang enabled auto-merge October 30, 2026 16:35
@github-actions github-actions Bot added documentation Improvements or additions to documentation locallibrary locallibrary and the loclib-* crates locallibrary: cli The locallibrary command line locallibrary: sidecar The JSON-RPC sidecar and the api module it serves locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: interop Libraries for Traktor, Serato and Engine DJ tests Tests, fixtures and test harnesses labels Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 679.4 KiB 679.4 KiB 0 B (0%)
Client JavaScript, brotli 225.6 KiB 225.6 KiB 0 B (0%)
Client CSS 89.6 KiB 89.6 KiB 0 B (0%)
Client CSS, brotli 12.9 KiB 12.9 KiB 0 B (0%)

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Rust coverage

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

Tests Lines Functions Regions
All 97.4% (83616/85851) 96.51% (13335/13817) 95.66% (183890/192230)
Hegel property tests alone 95.43% (81927/85851) 94.12% (13004/13817) 93.52% (179767/192230)

@botandbang

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI reruns on a merge ref that includes #344's destinations test fix. Branch unchanged.

@botandbang botandbang closed this Oct 31, 2026
auto-merge was automatically disabled October 31, 2026 03:26

Pull request was closed

@botandbang botandbang reopened this Oct 31, 2026
@botandbang botandbang closed this Oct 31, 2026
@botandbang botandbang reopened this Oct 31, 2026
@botandbang
botandbang enabled auto-merge October 31, 2026 03:26
@botandbang
botandbang merged commit 440cbb5 into main Oct 31, 2026
158 of 192 checks passed
@botandbang
botandbang deleted the bnb/collection-export branch October 31, 2026 03:52
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: cli The locallibrary command line locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: interop Libraries for Traktor, Serato and Engine DJ locallibrary: sidecar The JSON-RPC sidecar and the api module it serves locallibrary locallibrary and the loclib-* crates tests Tests, fixtures and test harnesses

Projects

None yet

2 participants