Tweak code

This commit is contained in:
vfsfitvnm 2022-09-27 17:29:32 +02:00
parent 83230e3817
commit 0d3ce95c80
2 changed files with 3 additions and 4 deletions

View file

@ -87,7 +87,7 @@ fun AlbumOverview(
withContext(Dispatchers.IO) {
Database.album(browseId).collect { album ->
if (album?.timestamp == null) {
YouTube.album(browseId)?.map { youtubeAlbum ->
YouTube.album(browseId)?.onSuccess { youtubeAlbum ->
Database.upsert(
Album(
id = browseId,
@ -109,8 +109,8 @@ fun AlbumOverview(
)
} ?: emptyList()
)
null
}?.onFailure { throwable ->
value = Result.failure(throwable)
}
} else {
value = Result.success(album)

View file

@ -28,7 +28,6 @@ import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import it.vfsfitvnm.vimusic.Database
import it.vfsfitvnm.vimusic.LocalPlayerServiceBinder
import it.vfsfitvnm.vimusic.enums.ThumbnailRoundness
import it.vfsfitvnm.vimusic.service.LoginRequiredException
import it.vfsfitvnm.vimusic.service.PlayableFormatNotFoundException
import it.vfsfitvnm.vimusic.service.UnplayableException