library: reconcile artist credits with playback and downloads

Left-join albums in the artist queue queries so albumless credited songs can
be played, downloaded and deleted. Add sortName to the starred index, persist
a per-source stale-credit marker so an interrupted sync cannot strand artist
counts or hide artists, and recompute artist play data in one grouped pass.
This commit is contained in:
austinried
2026-10-18 06:42:40 +00:00
parent c64cdd5172
commit 9d9550be48
10 changed files with 2032 additions and 34 deletions
@@ -29,6 +29,15 @@ interface SourcesDao {
@Query("SELECT id FROM sources WHERE isActive = 1 LIMIT 1")
suspend fun activeSourceIdOnce(): Long?
@Query("SELECT creditsStale FROM sources WHERE id = :sourceId")
suspend fun creditsStale(sourceId: Long): Boolean?
@Query("UPDATE sources SET creditsStale = :stale WHERE id = :sourceId")
suspend fun setCreditsStale(
sourceId: Long,
stale: Boolean,
)
@Insert
suspend fun insertSource(source: Source): Long