db: carry the sort-name mode through the paging builders

Rebase follow-up for the new SortNameMode preference: pass it into the
shared album/artist order functions so downloaded pages honour it too,
cover the new _plain indexes in the downloaded artist plan test, and add a
downloaded-mode ordering test.
This commit is contained in:
austinried
2026-11-03 01:03:45 +00:00
parent c165a6cc88
commit 6f1e05d15a
2 changed files with 73 additions and 3 deletions
@@ -110,7 +110,11 @@ internal fun albumsPageQuery(
sortNameMode: SortNameMode = SortNameMode.SortName,
): RoomRawQuery =
rawQuery(
sql = "SELECT * ${if (downloaded) ALBUMS_FILTER_DOWNLOADED else ALBUMS_FILTER} ORDER BY ${albumOrder(sort, descending, sortNameMode)}",
sql = "SELECT * ${if (downloaded) ALBUMS_FILTER_DOWNLOADED else ALBUMS_FILTER} ORDER BY ${albumOrder(
sort,
descending,
sortNameMode,
)}",
bindings =
mapOf(
"sourceId" to sourceId,