Summary
tracks_for_sequence() JOINs track_class:
FROM tracks t
JOIN track_class tc ON tc.track_id = t.spotify_id
LEFT JOIN enrichment e ON e.track_id = t.spotify_id
...
WHERE t.is_liked = 1
If a track is inserted directly into tracks (e.g. a playlist-only track added manually) but classify has not been run, there is no track_class row, so the track is excluded from the sequence pool entirely — even when it already has full enrichment (BPM/camelot/energy) data.
Impact
resequence on such a playlist sequences only a handful of tracks and dumps the rest as "no mixing data" / original order, despite the data being present. Requires a separate classify step that is easy to forget.
Expected
Either:
tracks_for_sequence should LEFT JOIN track_class (and treat missing buckets as permissive), or
- the enrichment/import flow should always run
classify (or create a default bucket) so pool membership does not silently depend on a separate manual step.
Reproduction
- Insert playlist tracks into
tracks with is_liked=1 and enrich them (enrichment rows present).
- Skip
classify.
- Run
resequence "<playlist-url>" --create "reseq" → only 1–3 tracks sequenced.
- Run
classify, then resequence again → 148/157 tracks sequenced.
Summary
tracks_for_sequence()JOINstrack_class:If a track is inserted directly into
tracks(e.g. a playlist-only track added manually) butclassifyhas not been run, there is notrack_classrow, so the track is excluded from the sequence pool entirely — even when it already has fullenrichment(BPM/camelot/energy) data.Impact
resequenceon such a playlist sequences only a handful of tracks and dumps the rest as "no mixing data" / original order, despite the data being present. Requires a separateclassifystep that is easy to forget.Expected
Either:
tracks_for_sequenceshould LEFT JOINtrack_class(and treat missing buckets as permissive), orclassify(or create a default bucket) so pool membership does not silently depend on a separate manual step.Reproduction
trackswithis_liked=1and enrich them (enrichment rows present).classify.resequence "<playlist-url>" --create "reseq"→ only 1–3 tracks sequenced.classify, thenresequenceagain → 148/157 tracks sequenced.