mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-06 02:40:58 +01:00
Fix showing live tv programs on home page (#1504)
## Description Fixes the inconsistent live tv programs shown on the home page by using a different API endpoint & filtering. Also some UI fixes: - Use the "Watch live" string consistently for the row instead of it sometimes switching to "Live TV" - Adjust the "Ends at" in the home page header to show the actual end time - Show the channel name in "quick details" - Show season & episode number, if applicable, in "quick details" ### Related issues Fixes #1080 ### Testing Nvidia shield w/ fake EPG data ## Screenshots N/A, just UI fixes, nothing new ## AI or LLM usage None
This commit is contained in:
parent
6c64470c28
commit
5ae452155e
7 changed files with 88 additions and 25 deletions
|
|
@ -92,7 +92,12 @@ data class BaseItem(
|
|||
|
||||
val favorite get() = data.userData?.isFavorite ?: false
|
||||
|
||||
val timeRemainingOrRuntime: Duration? get() = data.timeRemaining ?: data.runTimeTicks?.ticks
|
||||
val timeRemainingOrRuntime: Duration?
|
||||
get() =
|
||||
when (type) {
|
||||
BaseItemKind.PROGRAM -> null
|
||||
else -> data.timeRemaining ?: data.runTimeTicks?.ticks
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains pre computed UI elements that would be expensive to create on the main thread
|
||||
|
|
@ -137,6 +142,17 @@ data class BaseItem(
|
|||
} else if (type == BaseItemKind.BOX_SET) {
|
||||
data.productionYear?.let { add(it.toString()) }
|
||||
data.childCount?.let { add("$it items") }
|
||||
} else if (type == BaseItemKind.PROGRAM) {
|
||||
data.channelName?.let(::add)
|
||||
if (data.isSeries == true) {
|
||||
// TV episode
|
||||
data.seasonEpisode?.let(::add)
|
||||
data.premiereDate?.let {
|
||||
add(getDateFormatter().format(it))
|
||||
}
|
||||
} else {
|
||||
data.productionYear?.let { add(it.toString()) }
|
||||
}
|
||||
} else {
|
||||
data.productionYear?.let { add(it.toString()) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue