mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 15:32:01 +00:00
Update MetaDetailsScreen.kt
This commit is contained in:
parent
37203d1fc1
commit
3f5dd06f46
1 changed files with 10 additions and 1 deletions
|
|
@ -434,12 +434,21 @@ fun MetaDetailsScreen(
|
||||||
}
|
}
|
||||||
val playText = stringResource(Res.string.action_play)
|
val playText = stringResource(Res.string.action_play)
|
||||||
val resumeText = stringResource(Res.string.action_resume)
|
val resumeText = stringResource(Res.string.action_resume)
|
||||||
val playButtonLabel = remember(movieProgress, seriesAction, meta.type, hasEpisodes, playText, resumeText) {
|
val watchAgainText = stringResource(Res.string.action_watch_again)
|
||||||
|
val isMovieWatched = remember(meta.id, meta.type, hasEpisodes, watchedUiState.watchedKeys) {
|
||||||
|
meta.type != "series" && !hasEpisodes && WatchedRepository.isWatched(
|
||||||
|
id = meta.id,
|
||||||
|
type = meta.type,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val playButtonLabel = remember(movieProgress, isMovieWatched, seriesAction, meta.type, hasEpisodes, playText, resumeText, watchAgainText) {
|
||||||
when {
|
when {
|
||||||
(meta.type == "series" || hasEpisodes) && seriesAction != null ->
|
(meta.type == "series" || hasEpisodes) && seriesAction != null ->
|
||||||
seriesAction.label
|
seriesAction.label
|
||||||
meta.type != "series" && !hasEpisodes && movieProgress != null ->
|
meta.type != "series" && !hasEpisodes && movieProgress != null ->
|
||||||
resumeText
|
resumeText
|
||||||
|
isMovieWatched ->
|
||||||
|
watchAgainText
|
||||||
else -> playText
|
else -> playText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue