Lots of UI changes
This commit is contained in:
parent
6e185b25b7
commit
379559c076
16 changed files with 557 additions and 71 deletions
|
|
@ -0,0 +1,30 @@
|
|||
package com.github.damontecres.dolphin.data.model
|
||||
|
||||
import com.github.damontecres.dolphin.ui.nav.Destination
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.Transient
|
||||
import org.jellyfin.sdk.api.client.ApiClient
|
||||
import org.jellyfin.sdk.api.client.extensions.imageApi
|
||||
import org.jellyfin.sdk.model.api.BaseItemDto
|
||||
import org.jellyfin.sdk.model.api.ImageType
|
||||
|
||||
@Serializable
|
||||
data class BaseItem(
|
||||
val data: BaseItemDto,
|
||||
val imageUrl: String?,
|
||||
) {
|
||||
@Transient val id = data.id
|
||||
|
||||
@Transient val type = data.type
|
||||
|
||||
@Transient val name = data.name
|
||||
|
||||
fun destination() = Destination.MediaItem(id, type, this)
|
||||
|
||||
companion object {
|
||||
fun from(
|
||||
dto: BaseItemDto,
|
||||
api: ApiClient,
|
||||
) = BaseItem(dto, api.imageApi.getItemImageUrl(dto.id, ImageType.PRIMARY))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue