share the artist song ordering and pin it with a test

This commit is contained in:
austinried
2026-10-04 00:30:05 +00:00
parent 336ff1a1d1
commit 77c3959c48
2 changed files with 15 additions and 2 deletions
@@ -2282,6 +2282,19 @@ class PlaybackControllerTest {
assertEquals(setOf("a1", "a2", "a3", "b1", "b2"), handle.items.map { it.id }.toSet())
}
@Test
fun artistQueueRowsFollowTheFlatShuffleIdOrder() {
seedArtist()
runBlocking { queues.replace(listOf(queues.artistEntry(1, "ar1"))) }
val snapshot = runBlocking { queues.snapshot() }
val paged = (0 until snapshot.size).map { runBlocking { queues.itemAt(snapshot, it)?.song?.id } }
val flat = runBlocking { db.queueDao().artistSongIds(1, "ar1") }
assertEquals(listOf("b1", "b2", "a1", "a2", "a3"), flat)
assertEquals(flat, paged)
}
@Test
fun restoringResumesFromTheSavedPosition() {
seedAlbum(3, sourceId = 1)