mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 07:21:58 +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 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 {
|
||||
(meta.type == "series" || hasEpisodes) && seriesAction != null ->
|
||||
seriesAction.label
|
||||
meta.type != "series" && !hasEpisodes && movieProgress != null ->
|
||||
resumeText
|
||||
isMovieWatched ->
|
||||
watchAgainText
|
||||
else -> playText
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue