library: keep the cached bio on an empty refresh

This commit is contained in:
austinried
2026-10-19 13:14:08 +00:00
parent b379a22517
commit 98398ab2fe
2 changed files with 22 additions and 1 deletions
@@ -311,6 +311,24 @@ class LibraryRepositoryTest {
}
}
@Test
fun anEmptyRefreshKeepsTheStoredBio() =
runBlocking {
withSource { server ->
val sourceId = sourceRepository.activeSourceIdOnce()!!
db.libraryDao().upsertArtistBio(ArtistBio(sourceId, "ar1", "Kept"))
server.enqueue(
MockResponse().setBody(
"<subsonic-response status=\"ok\"><artistInfo2/></subsonic-response>",
),
)
assertTrue(repository.refreshArtistBio(sourceId, "ar1").isSuccess)
assertEquals("Kept", repository.artistBio(sourceId, "ar1").first()?.biography)
}
}
@Test
fun aFailedRefreshKeepsTheStoredBio() =
runBlocking {