Repository navigation
smart: read and compare dates as rekordbox does - #96
Merged
Merged
Conversation
rekordbox reads a date by position from a 10-character value, ignoring the separators, and keeps out-of-range days and months as dates; a blank or malformed date is no date and matches no date rule. Imports no longer give such tracks today's date, and rule values are read the same way. Relative rules follow pastDayToDay and pastMonthToDay: the last n days start n-1 days back, the last n months start on the last day of the month n months back, only the unit month counts months, and a count below one counts as one. dateReleased rules now test the track's release date, which the import now keeps. The web editor lists date created, release date, and the imported date operators, and date rule values may be plain YYYY-MM-DD.
Tracks imported from rekordbox carry its DateCreated and ReleaseDate, which smart playlist rules test but nothing displayed. The track info now includes them as date_created and release_date, the track drawer shows them as CREATED and RELEASED, and the track table offers them as optional columns.
rbCount duplicated the integer reading rbInt now does for numeric rule values; relative-date counts use rbInt.
vynulldev
force-pushed
the
conformance-smart-dates
branch
from
October 17, 2026 22:11
00e2b24 to
0a326e3
Compare
vynulldev
marked this pull request as ready for review
October 17, 2026 22:50
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
Imported smart playlists with date rules matched different tracks from rekordbox's. link-spec's date suites (and its disassembly of rekordbox's
dateToDay,pastDayToDayandpastMonthToDay) show how rekordbox reads and compares dates, and Vynull now does the same.Reading dates (
library.ParseRekordboxDate, used for track dates on import and for rule values)2025/01/31,2025.01.31and2025 01 31are all January 31.2025-02-29rolls over as the C runtime does).Relative rules ("in the last" and "not in the last")
month, in any letter case, counts months. Every other unit counts days, includingweek,year, plurals and unknown units.Release date:
dateReleasedrules now work. The import keeps rekordbox's ReleaseDate, which the dump tool now exports.Showing the dates:
date_createdandrelease_date(YYYY-MM-DD, imported tracks only), and the OpenAPI spec lists them.Web editor:
YYYY-MM-DD, which is what the editor's date input produces.Conformance against rekordbox 7.2.19 goes from 2,764 to 2,876 of 4,250 exact (+112, none lost). The three date matrices now match in full: smart-date-matrix 30/30, smart-relative-date-matrix 56/56, smart-date-format-matrix 117/117. The rest of smart-serving-crosses is out of this PR's scope:
Hardware testing
Checklist
go build ./...,go vet ./..., andgo test ./...passgofmt -l .is cleanGPL-3.0-or-later)