From b18e0891f655c2387c853b41589656a99f179ac7 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:33:40 +0000 Subject: [PATCH] db: tighten the paging observer and filter comments --- app/src/main/kotlin/com/subtracks/data/db/LibraryDao.kt | 4 ++-- app/src/main/kotlin/com/subtracks/data/db/LibraryPaging.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/subtracks/data/db/LibraryDao.kt b/app/src/main/kotlin/com/subtracks/data/db/LibraryDao.kt index 9090bc09..85cb1cdc 100644 --- a/app/src/main/kotlin/com/subtracks/data/db/LibraryDao.kt +++ b/app/src/main/kotlin/com/subtracks/data/db/LibraryDao.kt @@ -748,8 +748,8 @@ interface LibraryDao { @RawQuery(observedEntities = [Playlist::class]) fun playlistsPaging(query: RoomRawQuery): PagingSource - // These observe every table the statement reads, matching what Room inferred for the - // hand-written downloaded queries, so download and library writes invalidate as before. + // These observe every table the statements read; the sets match what Room inferred for the + // old downloaded @Query methods, so download and library writes invalidate as before. @RawQuery(observedEntities = [Album::class, Song::class, SongDownload::class, AlbumSearch::class]) fun downloadedAlbumsPaging(query: RoomRawQuery): PagingSource diff --git a/app/src/main/kotlin/com/subtracks/data/db/LibraryPaging.kt b/app/src/main/kotlin/com/subtracks/data/db/LibraryPaging.kt index 8efa2c0b..0da3322a 100644 --- a/app/src/main/kotlin/com/subtracks/data/db/LibraryPaging.kt +++ b/app/src/main/kotlin/com/subtracks/data/db/LibraryPaging.kt @@ -8,7 +8,7 @@ import com.subtracks.data.prefs.PlaylistSort import com.subtracks.data.prefs.SortNameMode // The default filters intentionally omit song_downloads: the unfiltered lists do not need the -// join, and their paging sources must not invalidate on download progress updates. +// join, and their paging sources do not observe download writes (including progress updates). internal const val ALBUMS_FILTER = """ FROM albums WHERE sourceId = :sourceId AND (:starredFilter = 0 OR (:starredFilter = 1 AND starred IS NOT NULL) OR (:starredFilter = 2 AND starred IS NULL))