mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Code cleanup
This commit is contained in:
parent
8792c7dcb2
commit
2c2d3900d7
2 changed files with 1 additions and 40 deletions
|
|
@ -172,7 +172,7 @@ class LiveTvViewModel
|
|||
val fakePrograms =
|
||||
(0..<MAX_HOURS).map {
|
||||
TvProgram(
|
||||
id = UUID.randomUUID(), // TODO
|
||||
id = UUID.randomUUID(),
|
||||
channelId = channel.id,
|
||||
start = start.plusHours(it),
|
||||
end = start.plusHours(it + 1),
|
||||
|
|
@ -233,8 +233,6 @@ class LiveTvViewModel
|
|||
}
|
||||
|
||||
fun cancelRecording(
|
||||
programIndex: Int,
|
||||
programId: UUID,
|
||||
series: Boolean,
|
||||
timerId: String?,
|
||||
) {
|
||||
|
|
@ -251,7 +249,6 @@ class LiveTvViewModel
|
|||
}
|
||||
|
||||
fun record(
|
||||
programIndex: Int,
|
||||
programId: UUID,
|
||||
series: Boolean,
|
||||
) {
|
||||
|
|
@ -289,31 +286,6 @@ class LiveTvViewModel
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun refreshProgram(
|
||||
programIndex: Int,
|
||||
programId: UUID,
|
||||
) = mutex.withLock {
|
||||
loading.setValueOnMain(LoadingState.Loading)
|
||||
// TODO
|
||||
// val program by api.liveTvApi.getProgram(programId.toServerString())
|
||||
// val newProgram =
|
||||
// programs.value?.getOrNull(programIndex)?.copy(
|
||||
// isRecording = program.timerId.isNotNullOrBlank(),
|
||||
// isSeriesRecording = program.seriesTimerId.isNotNullOrBlank(),
|
||||
// )
|
||||
// Timber.v("new program %s", newProgram)
|
||||
// if (newProgram != null) {
|
||||
// programs.value
|
||||
// ?.toMutableList()
|
||||
// ?.apply {
|
||||
// this[programIndex] = newProgram
|
||||
// }?.let {
|
||||
// this@LiveTvViewModel.programs.setValueOnMain(it)
|
||||
// }
|
||||
// }
|
||||
loading.setValueOnMain(LoadingState.Success)
|
||||
}
|
||||
|
||||
private var focusLoadingJob: Job? = null
|
||||
|
||||
fun onFocusChannel(position: RowColumn) {
|
||||
|
|
|
|||
|
|
@ -104,11 +104,9 @@ fun TvGuideGrid(
|
|||
TvGuideGrid(
|
||||
loading = state is LoadingState.Loading,
|
||||
channels = channels,
|
||||
// programList = programs,
|
||||
programs = programs,
|
||||
channelProgramCount = viewModel.channelProgramCount,
|
||||
start = viewModel.start,
|
||||
// channelOffset = fetchedRange.start,
|
||||
onClickChannel = { index, channel ->
|
||||
viewModel.navigationManager.navigateTo(
|
||||
Destination.Playback(
|
||||
|
|
@ -166,7 +164,6 @@ fun TvGuideGrid(
|
|||
onRecord = { series ->
|
||||
fetchedItem?.let {
|
||||
viewModel.record(
|
||||
programIndex = showItemDialog!!,
|
||||
programId = it.id,
|
||||
series = series,
|
||||
)
|
||||
|
|
@ -176,8 +173,6 @@ fun TvGuideGrid(
|
|||
onCancelRecord = { series ->
|
||||
fetchedItem?.data?.let {
|
||||
viewModel.cancelRecording(
|
||||
programIndex = showItemDialog!!,
|
||||
programId = it.id,
|
||||
series = series,
|
||||
timerId = if (series) it.seriesTimerId else it.timerId,
|
||||
)
|
||||
|
|
@ -190,21 +185,16 @@ fun TvGuideGrid(
|
|||
}
|
||||
}
|
||||
|
||||
const val CHANNEL_COLUMN = -1
|
||||
|
||||
@Composable
|
||||
fun TvGuideGrid(
|
||||
loading: Boolean,
|
||||
channels: List<TvChannel>,
|
||||
// programList: List<TvProgram>,
|
||||
// programs: Map<UUID, List<TvProgram>>,
|
||||
programs: FetchedPrograms,
|
||||
channelProgramCount: Map<UUID, Int>,
|
||||
start: LocalDateTime,
|
||||
onClickChannel: (Int, TvChannel) -> Unit,
|
||||
onClickProgram: (Int, TvProgram) -> Unit,
|
||||
onFocus: (RowColumn) -> Unit,
|
||||
// channelOffset: Int,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
|
@ -517,7 +507,6 @@ fun TvGuideGrid(
|
|||
Box(
|
||||
modifier =
|
||||
Modifier
|
||||
// .scale(if (focused) 1.1f else 1f)
|
||||
.padding(2.dp)
|
||||
.fillMaxSize()
|
||||
.background(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue