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:
Damontecres 2026-06-03 12:40:53 -04:00 • committed by GitHub
parent 6c64470c28
commit 5ae452155e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 88 additions and 25 deletions

View file

@ -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()) }
}