Skip to content

Traktor improvements - #137

Merged
pSpitzner merged 5 commits into
mainfrom
traktor_search
Nov 20, 2026
Merged

pSpitzner merged 5 commits into
mainfrom
traktor_search

Conversation

@pSpitzner

Copy link
Copy Markdown
Contributor
  • adds search cli by implementing find_by_info
  • fixes missing trackinfo (artist, title) from nmplaylist.tracks. this was visible when showing playlists.
  • makes nmlpath immutable
  • speeds up track lookup in nmlibrary by adding a cache from nmlpath to resolved track

TODO (separate PR):

  • decide how search / find_by_info should work for all services: match any or match all?
  • we dont really control it for spotify etc, where the api handles the search, but we can at least make the services where we implement it ourselves consistent.

@github-actions

Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@pSpitzner
pSpitzner requested a review from semohr September 30, 2026 21:47
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.61017% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
plistsync/services/traktor/library.py 96.66% 0 Missing and 1 partial ⚠️
plistsync/services/traktor/playlist.py 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread plistsync/services/traktor/path.py Resolved
Comment thread plistsync/services/traktor/path.py Resolved
Comment thread plistsync/services/traktor/playlist.py Resolved
Comment thread plistsync/services/traktor/track.py Resolved
@pSpitzner
pSpitzner temporarily deployed to integration_tests October 1, 2026 14:12 — with GitHub Actions Inactive
@pSpitzner
pSpitzner temporarily deployed to integration_tests October 1, 2026 14:12 — with GitHub Actions Inactive
NMLPath kept its parts in a mutable list and was unhashable, so paths could
not be used as dictionary keys while also being mutable behind the scenes.

- store parts as a tuple, make the class a frozen, slotted dataclass
- take the optional volume id as a constructor argument instead of setting
  the private attribute after construction
- derive equality and hashing from the dataclass: the volume id is excluded,
  so a playlist path (volume name only) equals the collection path of the
  same file
Every path lookup ran an XPath query over the whole COLLECTION node, and a
track inserted into the library forced the next lookup to scan again.

- build a NMLPath -> NMLTrack index on first use and reuse it afterwards
- keep the index in sync on insert instead of dropping it
NML collections only offered identifier lookups, so matching fell back to
iterating every track in the calling code.

find_by_info scans the collection and returns tracks whose metadata contains
every supplied, non-empty field as a case-insensitive substring. Artists and
albums match when any requested value is contained in any value of the track.
NMLPlaylistTrack.info always returned an empty TrackInfo, because playlist
entries only store a path while metadata lives in the main collection.

Playlist tracks can now hold a reference to the owning NMLLibrary and resolve
their path through it. Playlists pass their library on load, on lookup and on
assignment, so tracks keep the link across playlist edits.
- mark Traktor as supporting metadata lookups in the capability table
- mention in the matching guide that the metadata search itself depends on
  the service, with a local collection matching substrings
@semohr
semohr temporarily deployed to integration_tests November 9, 2026 18:59 — with GitHub Actions Inactive
@semohr
semohr temporarily deployed to integration_tests November 9, 2026 18:59 — with GitHub Actions Inactive
@semohr
semohr changed the base branch from main to docs_update November 9, 2026 18:59
@semohr
semohr changed the base branch from docs_update to main November 20, 2026 14:08
@pSpitzner
pSpitzner merged commit 7bea06f into main Nov 20, 2026
14 checks passed

This branch was previously deployed

1 inactive deployment
integration_tests — 72c53d9d Deployed Nov 9, 2026 by semohr via integration-tests (spotify) #606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants