mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-06 02:40:58 +01:00
View more from home page & recommended rows (#1392)
## Description Adds a card at the end of the rows on the home page and recommended tabs to "View More" which goes to a grid of the items in the row. The grid will endlessly scroll all of the available items except for a few cases where the first 1000 are shown because the server does not (yet) support pagination: genres, studios, people (added in v12), and latest grouped tv shows. Dev notes: This PR also rewrites the `RecommendedViewModel` and consolidates the previous multiple view models into one. ### Related issues Closes #1371 Closes #1035 Similar to #1198 ### Testing Emulator ## Screenshots N/A, see #1198 ## AI or LLM usage None
This commit is contained in:
parent
98ffaf51ac
commit
f4bdb8446e
21 changed files with 1417 additions and 1075 deletions
|
|
@ -4,9 +4,15 @@ import androidx.annotation.PluralsRes
|
|||
import androidx.annotation.StringRes
|
||||
import com.github.damontecres.wholphin.R
|
||||
import com.github.damontecres.wholphin.data.model.BaseItem
|
||||
import com.github.damontecres.wholphin.ui.AspectRatio
|
||||
import com.github.damontecres.wholphin.ui.components.ViewOptions
|
||||
import com.github.damontecres.wholphin.ui.nav.Destination
|
||||
import com.github.damontecres.wholphin.util.GetItemsRequestHandler
|
||||
import org.jellyfin.sdk.model.UUID
|
||||
import org.jellyfin.sdk.model.api.ExtraType
|
||||
import org.jellyfin.sdk.model.api.ItemSortBy
|
||||
import org.jellyfin.sdk.model.api.SortOrder
|
||||
import org.jellyfin.sdk.model.api.request.GetItemsRequest
|
||||
|
||||
/**
|
||||
* Represents "extras" for media such as behind-the-scenes or deleted scenes
|
||||
|
|
@ -34,7 +40,24 @@ sealed interface ExtrasItem {
|
|||
override val isPlayed: Boolean,
|
||||
) : ExtrasItem {
|
||||
override val destination: Destination =
|
||||
Destination.ItemGrid(null, type.stringRes, items.map { it.id })
|
||||
Destination.ItemGrid(
|
||||
title = null,
|
||||
titleRes = type.stringRes,
|
||||
request =
|
||||
GetItemsRequest(
|
||||
ids = items.map { it.id },
|
||||
sortBy = listOf(ItemSortBy.SORT_NAME),
|
||||
sortOrder = listOf(SortOrder.ASCENDING),
|
||||
),
|
||||
requestHandler = GetItemsRequestHandler,
|
||||
initialPosition = 0,
|
||||
viewOptions =
|
||||
ViewOptions(
|
||||
columns = 3,
|
||||
spacing = 24,
|
||||
aspectRatio = AspectRatio.WIDE,
|
||||
),
|
||||
)
|
||||
|
||||
override val playedPercentage
|
||||
get() = -1.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue