Repository navigation
library: import Traktor collection.nml (tracks, playlists, cues) - #5
Merged
Merged
Conversation
Add a Traktor NML importer alongside the rekordbox XML/master.db ones. It parses collection.nml into library.Track plus the nested playlist tree, and converts CUE_V2 markers into the shared MasterDBCue carrier the import applier already consumes. - Tracks: title/artist/album/genre, BPM, key (INFO KEY text, falling back to a MUSICAL_KEY 0-23 -> standard-notation map), rating (0-255 -> 0-5 stars), year, track number, label, comment, play count, bitrate (bits/s -> kbps), file size. - Paths: decode Traktor's "/:"-separated DIR, prepend a Windows drive volume, leave the mac/Linux boot volume off. Unresolved files fall through to the existing missing-file flagging + path remap. - Playlists: walk the NODE/SUBNODES tree, resolving each PRIMARYKEY to a track via its VOLUME+DIR+FILE location key. - Cues: hot cues map Traktor's 0-7 to the 1-8 slot convention, memory cues and loops carry through, and the grid anchor (TYPE 4) and stray fade markers are dropped. Wired into the api.go import dispatch (.nml) and the import dialog (Traktor source, tracks/playlists/cues options, collection.nml placeholder). Covered by a unit test over a 2-track fixture with a nested playlist folder and a full CUE_V2 set.
The import form now handles Traktor as well as rekordbox, so the rekordbox-specific button and title copy was misleading. Rename the empty-state and settings buttons to "Import your library" / "Import a library", retitle the dialog "IMPORT LIBRARY", note both ecosystems in the sub-label, and add a Traktor collection.nml line to the dialog hint. Internal ids and handler names are left unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds a Traktor NML importer alongside the existing rekordbox XML / master.db / backup importers, so a Traktor user can bring their whole library into Vynull. First non-rekordbox library format. Traktor stores everything in one XML file (collection.nml), so this mirrors the rekordbox-XML importer and plugs into the same import pipeline.
Imports:
Paths: Traktor encodes the directory with "/:" separators, so the importer rebuilds the real path, prepends a Windows drive volume, and leaves the mac/Linux boot volume off. Files that do not resolve locally fall through to the existing missing-file flagging and the import dialog's path-remap field, exactly like a rekordbox import from another machine.
UI: the import dialog gets a Traktor source radio, the tracks/playlists/cues include options, and a collection.nml placeholder. Because the form now handles more than rekordbox, the source-specific copy is generalized ("Import your library" / "Import a library", "IMPORT LIBRARY").
Caveats: best-effort path reconstruction across platforms, and worth validating against a real collection.nml since the NML format drifts between Traktor versions. Traktor CUE_V2 carries no per-cue colour, so imported cues take the default.
Hardware testing
Checklist
go build ./...,go vet ./..., andgo test ./...passgofmt -l .is cleanGPL-3.0-or-later)