mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
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:
parent
7fcd66f407
commit
91900af7a9
13 changed files with 229 additions and 64 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue