Add long clicking context menus everywhere (#202)

Adds long click context menus to just about every card throughout the
app. Previously only a few pages had this.

Closes #196
This commit is contained in:
damontecres 2025-11-12 15:36:36 -05:00 committed by GitHub
parent 5e2c75bb70
commit 2e3e4e3f5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 766 additions and 289 deletions

View file

@ -11,6 +11,7 @@ import org.jellyfin.sdk.model.api.BaseItemDto
import org.jellyfin.sdk.model.api.BaseItemKind
import org.jellyfin.sdk.model.api.ImageType
import org.jellyfin.sdk.model.extensions.ticks
import kotlin.time.Duration
@Serializable
data class BaseItem(
@ -18,29 +19,29 @@ data class BaseItem(
val imageUrl: String?,
val backdropImageUrl: String? = null,
) {
@Transient val id = data.id
val id get() = data.id
@Transient val type = data.type
val type get() = data.type
@Transient val name = data.name
val name get() = data.name
@Transient
val title = if (type == BaseItemKind.EPISODE) data.seriesName else name
val title get() = if (type == BaseItemKind.EPISODE) data.seriesName else name
@Transient
val subtitle =
if (type == BaseItemKind.EPISODE) data.seasonEpisode + " - " + name else data.productionYear?.toString()
@Transient
val resumeMs =
data.userData
?.playbackPositionTicks
?.ticks
?.inWholeMilliseconds
val subtitle
get() =
if (type == BaseItemKind.EPISODE) data.seasonEpisode + " - " + name else data.productionYear?.toString()
@Transient
val indexNumber = data.indexNumber ?: dateAsIndex()
val playbackPosition get() = data.userData?.playbackPositionTicks?.ticks ?: Duration.ZERO
val resumeMs get() = playbackPosition.inWholeMilliseconds
val played get() = data.userData?.played ?: false
val favorite get() = data.userData?.isFavorite ?: false
private fun dateAsIndex(): Int? =
data.premiereDate
?.let {