mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 08:01:20 +02:00
Only show record program button if it hasn't ended
This commit is contained in:
parent
36287be5d4
commit
de22933766
3 changed files with 55 additions and 47 deletions
|
|
@ -147,6 +147,7 @@ fun DvrSchedule(
|
|||
showDialog?.let { item ->
|
||||
ProgramDialog(
|
||||
item = item,
|
||||
canRecord = true,
|
||||
loading = LoadingState.Success,
|
||||
onDismissRequest = {
|
||||
showDialog = null
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import java.time.ZoneId
|
|||
@Composable
|
||||
fun ProgramDialog(
|
||||
item: BaseItem?,
|
||||
canRecord: Boolean,
|
||||
loading: LoadingState,
|
||||
onDismissRequest: () -> Unit,
|
||||
onWatch: () -> Unit,
|
||||
|
|
@ -138,6 +139,7 @@ fun ProgramDialog(
|
|||
.padding(top = 8.dp)
|
||||
.fillMaxWidth(),
|
||||
) {
|
||||
if (canRecord) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
) {
|
||||
|
|
@ -168,6 +170,8 @@ fun ProgramDialog(
|
|||
}
|
||||
}
|
||||
}
|
||||
if (dto.endDate?.isAfter(LocalDateTime.now()) ?: true) {
|
||||
// Only show program specific recording button if it hasn't finished yet
|
||||
Button(
|
||||
onClick = {
|
||||
if (isRecording) {
|
||||
|
|
@ -194,6 +198,8 @@ fun ProgramDialog(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (now.isAfter(dto.startDate!!) && now.isBefore(dto.endDate!!)) {
|
||||
Button(
|
||||
onClick = onWatch,
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ fun TvGuideGrid(
|
|||
val onDismissRequest = { showItemDialog = null }
|
||||
ProgramDialog(
|
||||
item = fetchedItem,
|
||||
canRecord = true,
|
||||
loading = loadingItem,
|
||||
onDismissRequest = onDismissRequest,
|
||||
onWatch = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue