When sorting by ascending track number for tracks with no assigned track number within an album, the order displayed is seemingly random.
However, when sorted by descending track number, the tracks are then sorted by their descending track name.
Ideally, when sorting by ascending track number, it should be sorting by ascending track name as a “backup” to be consistent with how it is sorted for the descending track number.
Logs:
Upload description: hexshade
Additional information:
Reproduction steps:
Select an album with no track numbers assigned to any of the tracks, and then sort them by ascending and then descending track number.
This is already the case (Except that it uses the sort title)
2025-11-09 02:11:43.851 Verbose QueryBuilder Query: SELECT .... FROM songs LEFT JOIN albums ON (songs.album_id=albums._id) WHERE (songs.album_id=?) ORDER BY songs.album_id DESC, songs.disc DESC, songs.track DESC, songs.sort_title COLLATE NOCASE DESC ('31') [200 in 10.83ms]
2025-11-09 02:11:56.301 Verbose QueryBuilder Query: SELECT ... WHERE (songs.album_id=?) ORDER BY songs.album_id ASC, songs.disc ASC, songs.track ASC, songs.sort_title COLLATE NOCASE ASC ('31') [200 in 10.91ms]
I can’t think of a reason for the sort to behave differently between asc and desc they are the ones shown above.