Improved home page support for Live TV & Recordings (#890)

## Description
Improves home page customization for Live TV & Recordings
- Add row for live tv channels
- Add row for "on now" programs
- Clicking on a TV channel or TV program starts playback
- Better name for "Recently recorded" instead of "Recently added in
Recordings"

Also fixes a back stack issue after adding rows

### Related issues
Follow up from #803 

### Testing
Emulator

## Screenshots
<img width="663" height="190" alt="image"
src="https://github.com/user-attachments/assets/49d41953-42ab-4621-92f1-b7936aab7e97"
/>

## AI or LLM usage
None
This commit is contained in:
Ray 2026-02-13 11:41:47 -05:00 committed by GitHub
parent 7fcd66f407
commit 91900af7a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 229 additions and 64 deletions

View file

@ -187,6 +187,25 @@ data class BaseItem(
)
}
BaseItemKind.TV_CHANNEL -> {
Destination.Playback(
itemId = id,
positionMs = 0L,
)
}
BaseItemKind.PROGRAM -> {
val channelId = data.channelId
if (channelId != null) {
Destination.Playback(
itemId = channelId,
positionMs = 0L,
)
} else {
Destination.MediaItem(this)
}
}
else -> {
Destination.MediaItem(this)
}

View file

@ -111,7 +111,7 @@ sealed interface HomeRowConfig {
}
/**
*
* Currently recording
*/
@Serializable
@SerialName("Recordings")
@ -122,7 +122,7 @@ sealed interface HomeRowConfig {
}
/**
*
* Programs on now/recommended
*/
@Serializable
@SerialName("TvPrograms")
@ -132,6 +132,17 @@ sealed interface HomeRowConfig {
override fun updateViewOptions(viewOptions: HomeRowViewOptions): TvPrograms = this.copy(viewOptions = viewOptions)
}
/**
* Live TV channels
*/
@Serializable
@SerialName("TvChannels")
data class TvChannels(
override val viewOptions: HomeRowViewOptions = HomeRowViewOptions(),
) : HomeRowConfig {
override fun updateViewOptions(viewOptions: HomeRowViewOptions): TvChannels = this.copy(viewOptions = viewOptions)
}
/**
* Fetch suggestions from [com.github.damontecres.wholphin.services.SuggestionService] for the given parent ID
*/
@ -217,5 +228,11 @@ data class HomeRowViewOptions(
heightDp = Cards.HEIGHT_EPISODE,
aspectRatio = AspectRatio.WIDE,
)
val channelsDefault =
HomeRowViewOptions(
heightDp = 96,
aspectRatio = AspectRatio.WIDE,
)
}
}