Repository navigation
smart: read SmartList XML and numeric values as rekordbox does - #97
Merged
Merged
Conversation
Two link-spec suites crashed before a case ran. The dump helper's strict XML parser rejected a LogicalOperator of "wat", and fractional values in integer columns broke the import. The helper now parses SmartList XML the way rekordbox's JUCE parser does: element names in any case, a closing tag need not match, a repeated attribute keeps its first value, and anything after the first root is ignored, while a byte-order mark, leading text, an unclosed element, or a bad entity leave no rules. Operator and LogicalOperator read as integers, and anything but LogicalOperator 2 means all-of. Property names match in any case. Stored numbers are read as rekordbox reads them: truncated, BPM as a signed 32-bit integer (a negative BPM matches no rule), Rating as a signed byte, and Length, ReleaseYear, and DJPlayCount as small unsigned numbers. Rule values read as integers saturating at the int32 limits, so 0.5 is 0. Real library values are unchanged. The KEY column shows the key alone for a zero tempo and a negative tempo by its magnitude, as rekordbox does.
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
Two of link-spec's smart-playlist suites crashed before a case ran, so the conformance run skipped them:
LogicalOperatorofwat.Both now run and match rekordbox in full. The rules come from link-spec's live results and its notes on rekordbox's parser.
SmartList XML (the dump helper now parses as rekordbox's JUCE parser does)
node,NoDe).OperatorandLogicalOperatorread as integers, and anyLogicalOperatorbut 2 means all-of.GENREworks).Numbers
Stored values are read as rekordbox reads them, truncated toward zero:
Real library values are unchanged.
Rule values read as integers saturating at the int32 limits, so
0.5is 0 and blank or text is 0.The KEY column shows the key alone for a track with zero tempo, and a negative stored tempo by its magnitude, as rekordbox does.
Conformance against rekordbox 7.2.19 goes from 2,764 to 2,942 of 4,250 exact (+178, none lost), and all 287 suites now complete: smart-numeric-boundaries 100/100, smart-xml-matrix 73/73, plus 2 in boundaries, 2 in smart-text-matrix and 1 in smart-rule-matrix.
Tests cover the dump helper's XML and number parsing (run under python3 with sqlcipher3 stubbed), rule integers, signed ratings, negative BPMs and the KEY column label.
Hardware testing
Checklist
go build ./...,go vet ./..., andgo test ./...passgofmt -l .is cleanGPL-3.0-or-later)