Files
Psychotoxical-psysonic/src-tauri
Psychotoxical 213431ccd9 fix(library): order album detail tracks by disc then track number (#1332)
* fix(library): order album detail tracks by disc then track number

Multi-disc album detail ordered tracks by track_number before disc_number, so
Play-All queued them interleaved (D1T1, D2T1, D1T2, D2T2, ...) instead of disc 1
in full, then disc 2. Order by (disc_number, track_number), matching the existing
convention in repos/track.rs. Adds a regression test.

* docs(changelog): note multi-disc album play order fix (#1332)

* fix(library): treat missing disc number as disc 1 in album ordering

Follow-up review. Album track ordering sorted NULL disc numbers last, but the
album UI renders a missing disc as disc 1 (discNumber ?? 1), so an untagged
disc-1 track was shown under Disc 1 while Play-All started with an explicit
disc 2. Order both album-track loaders — the scoped merge query and the direct
find_by_album query — by COALESCE(disc_number, 1), with id as the final
tie-break so equal disc/track metadata is deterministic across both paths.
Extends the regression test with a NULL-disc track and a duplicate disc/track
pair.

* fix(library): make album track order total across servers, cover direct loader

Re-review follow-up. The scoped album loader's `id` tie-break is only
server-local (the track primary key is (server_id, id)), so two cross-server
tracks surviving a merged album could tie on disc/track/id and be returned in an
arbitrary order. Add `server_id ASC` as the final key in both album-track loaders
so the Play-All order is total. Strengthen the direct find_by_album test to cover
the missing-disc (COALESCE) and duplicate-position (id) cases, and add a
multi-server regression asserting the tie resolves deterministically by server_id.
2026-07-23 00:11:31 +02:00
..