mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
More favorite tabs & add people to favorites (#210)
Adds Video, Playlists, & People tabs to the favorites page Also adds ability to add people to favorites via context menu or on their page Closes #199
This commit is contained in:
parent
655720fc05
commit
19b712d54b
13 changed files with 356 additions and 102 deletions
|
|
@ -6,6 +6,7 @@ import kotlinx.serialization.Serializable
|
|||
import kotlinx.serialization.UseSerializers
|
||||
import org.jellyfin.sdk.model.api.BaseItemKind
|
||||
import org.jellyfin.sdk.model.api.request.GetItemsRequest
|
||||
import org.jellyfin.sdk.model.api.request.GetPersonsRequest
|
||||
import org.jellyfin.sdk.model.serializer.UUIDSerializer
|
||||
import java.util.UUID
|
||||
|
||||
|
|
@ -19,6 +20,7 @@ data class GetItemsFilter(
|
|||
val studios: List<UUID>? = null,
|
||||
val tags: List<String>? = null,
|
||||
val includeItemTypes: List<BaseItemKind>? = null,
|
||||
val override: GetItemsFilterOverride = GetItemsFilterOverride.NONE,
|
||||
) {
|
||||
fun applyTo(req: GetItemsRequest) =
|
||||
req.copy(
|
||||
|
|
@ -31,4 +33,14 @@ data class GetItemsFilter(
|
|||
studioIds = studios,
|
||||
tags = tags,
|
||||
)
|
||||
|
||||
fun applyTo(req: GetPersonsRequest) =
|
||||
req.copy(
|
||||
isFavorite = favorite,
|
||||
)
|
||||
}
|
||||
|
||||
enum class GetItemsFilterOverride {
|
||||
NONE,
|
||||
PERSON,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ data class Person(
|
|||
val role: String?,
|
||||
val type: PersonKind,
|
||||
val imageUrl: String?,
|
||||
val favorite: Boolean,
|
||||
) {
|
||||
companion object {
|
||||
fun fromDto(
|
||||
|
|
@ -25,6 +26,21 @@ data class Person(
|
|||
role = dto.role,
|
||||
type = dto.type,
|
||||
imageUrl = api.imageApi.getItemImageUrl(dto.id, ImageType.PRIMARY),
|
||||
favorite = false,
|
||||
)
|
||||
|
||||
fun fromDto(
|
||||
dto: BaseItemPerson,
|
||||
favorite: Boolean,
|
||||
api: ApiClient,
|
||||
): Person =
|
||||
Person(
|
||||
id = dto.id,
|
||||
name = dto.name,
|
||||
role = dto.role,
|
||||
type = dto.type,
|
||||
imageUrl = api.imageApi.getItemImageUrl(dto.id, ImageType.PRIMARY),
|
||||
favorite = favorite,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue