musikr: miss covers when they cannot be decoded

This commit is contained in:
Alexander Capehart 2025-03-18 15:40:28 -06:00
parent 102ed85c42
commit ef7ef8da95
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -82,8 +82,12 @@ class MutableStoredCovers(
is CoverResult.Miss -> return CoverResult.Miss() is CoverResult.Miss -> return CoverResult.Miss()
} }
val innerCover = val innerCover =
coverStorage.write(memoryCover.id + transcoding.tag) { try {
transcoding.transcodeInto(memoryCover.data(), it) coverStorage.write(memoryCover.id + transcoding.tag) {
transcoding.transcodeInto(memoryCover.data(), it)
}
} catch (e: Exception) {
return CoverResult.Miss()
} }
return CoverResult.Hit(StoredCover(innerCover)) return CoverResult.Hit(StoredCover(innerCover))
} }