Remove Outcome class
This commit is contained in:
@@ -16,7 +16,7 @@ import androidx.compose.ui.text.style.TextDecoration
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.valentinilk.shimmer.shimmer
|
||||
import it.vfsfitvnm.vimusic.R
|
||||
import it.vfsfitvnm.vimusic.ui.components.Message
|
||||
import it.vfsfitvnm.vimusic.ui.components.themed.TextCard
|
||||
import it.vfsfitvnm.vimusic.ui.components.themed.TextFieldDialog
|
||||
import it.vfsfitvnm.vimusic.ui.components.themed.TextPlaceholder
|
||||
import it.vfsfitvnm.vimusic.ui.styling.LocalTypography
|
||||
@@ -64,10 +64,12 @@ fun LyricsView(
|
||||
.padding(horizontal = 48.dp)
|
||||
) {
|
||||
if (lyrics.isEmpty()) {
|
||||
Message(
|
||||
text = "Lyrics not available",
|
||||
icon = R.drawable.text,
|
||||
)
|
||||
TextCard(
|
||||
icon = R.drawable.sad
|
||||
) {
|
||||
Title(text = "No results found")
|
||||
Text(text = "Please try a different query or category.")
|
||||
}
|
||||
} else {
|
||||
BasicText(
|
||||
text = lyrics,
|
||||
|
||||
@@ -43,12 +43,12 @@ import it.vfsfitvnm.vimusic.enums.ThumbnailRoundness
|
||||
import it.vfsfitvnm.vimusic.models.Song
|
||||
import it.vfsfitvnm.vimusic.query
|
||||
import it.vfsfitvnm.vimusic.ui.components.*
|
||||
import it.vfsfitvnm.vimusic.ui.components.themed.LoadingOrError
|
||||
import it.vfsfitvnm.vimusic.ui.components.themed.QueuedMediaItemMenu
|
||||
import it.vfsfitvnm.vimusic.ui.styling.BlackColorPalette
|
||||
import it.vfsfitvnm.vimusic.ui.styling.LocalColorPalette
|
||||
import it.vfsfitvnm.vimusic.ui.styling.LocalTypography
|
||||
import it.vfsfitvnm.vimusic.utils.*
|
||||
import it.vfsfitvnm.youtubemusic.Outcome
|
||||
import it.vfsfitvnm.youtubemusic.YouTube
|
||||
import it.vfsfitvnm.youtubemusic.models.PlayerResponse
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -416,7 +416,7 @@ fun PlayerView(
|
||||
coroutineScope.launch(Dispatchers.IO) {
|
||||
YouTube
|
||||
.player(song.id)
|
||||
.map { body ->
|
||||
?.map { body ->
|
||||
Database.update(
|
||||
song.copy(
|
||||
loudnessDb = body.playerConfig?.audioConfig?.loudnessDb?.toFloat(),
|
||||
@@ -450,14 +450,14 @@ fun PlayerView(
|
||||
.padding(horizontal = 32.dp)
|
||||
.size(thumbnailSizeDp)
|
||||
) {
|
||||
Error(
|
||||
error = Outcome.Error.Unhandled(playerState.error!!),
|
||||
LoadingOrError(
|
||||
errorMessage = playerState.error?.javaClass?.canonicalName,
|
||||
onRetry = {
|
||||
player?.playWhenReady = true
|
||||
player?.prepare()
|
||||
playerState.error = null
|
||||
}
|
||||
)
|
||||
) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user