db: tighten the paging observer and filter comments

This commit is contained in:
austinried
2026-11-03 01:03:45 +00:00
parent c53f1aef06
commit b18e0891f6
2 changed files with 3 additions and 3 deletions
@@ -748,8 +748,8 @@ interface LibraryDao {
@RawQuery(observedEntities = [Playlist::class])
fun playlistsPaging(query: RoomRawQuery): PagingSource<Int, Playlist>
// 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<Int, Album>
@@ -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))