Repository navigation
dbserver: serve an imported date added as rekordbox stored it - #194
Merged
Merged
Conversation
rekordbox serves a track's Date Added (StockDate) as stored, whatever text it holds. Vynull parsed it into a date on import and formatted it again, so any stored text that isn't a clean YYYY-MM-DD came out empty. A master.db import now keeps the stored text when it isn't the date it parses to (Track.DateAddedText; every canonical date needs nothing extra), and the Date Added column, the render override, sorting by date added, TRACK INFO and Delivery Info serve Track.DateAddedString: that text, else the date. Smart playlists still read the parsed date. The render override cuts a date added to 255 characters and leaves a render unanswered when its text still takes more than 255 UTF-16 units, as it already does for a comment (link-spec's secondary string limits).
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
rekordbox serves a track's Date Added (
djmdContent.StockDate) as stored, whatever text it holds: in the Date Added column, by the render override, and in TRACK INFO and Delivery Info. Vynull parsed it into a date on import and formatted it again, so any stored text that isn't a clean YYYY-MM-DD came out empty. link-spec records these values in its string-threshold, boundary and Display Song Info suites.Changes:
Track.DateAddedText, cut at a NUL as rekordbox's strings are). Every canonical date needs nothing extra, so a real library's import is unchanged.Track.DateAddedString: that text, else the date as before. Smart playlists still read the parsed date.Tests:
TestStoredDateText: canonical, empty, reformatted and non-date text, and a NUL.TestDateAddedStoredText: the Date Added column, the override's 255-character cut and its 256-unit stall, and TRACK INFO.Both use the new field, so they don't build on main.
Conformance against main, on the default-settings fixtures: 3,658 to 3,676 of 4,250 cases exact (+18, none lost): display-song-info-unicode-boundaries +8, secondary-string-thresholds +6, secondary-unicode-thresholds +3 and display-song-info-invalid +1. The remaining date-added cases now stall the render as rekordbox does and differ only in the harness's timeout label, as the comment cases already did. The Display Song Info and Delivery cases that also carry custom colour names are left for that change.
Cost: none:
BenchmarkTrackList(default, and changed, which rebuilds every row of a 20k-track library) keeps the same bytes and allocations per request, with times within noise over six alternating runs.Build, vet, gofmt, all tests, the race detector on the dbserver and the library, and the e2e suite pass.
Hardware testing
Checklist
go build ./...,go vet ./..., andgo test ./...passgofmt -l .is cleanGPL-3.0-or-later)