mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
parent
6edcfb1067
commit
d2e1c4683d
6 changed files with 8 additions and 10 deletions
|
|
@ -47,6 +47,9 @@ data class BaseItem(
|
|||
}
|
||||
}
|
||||
|
||||
@Transient
|
||||
val aspectRatio: Float? = data.primaryImageAspectRatio?.toFloat()?.takeIf { it > 0 }
|
||||
|
||||
@Transient
|
||||
val indexNumber = data.indexNumber ?: dateAsIndex()
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ fun EpisodeCard(
|
|||
} else {
|
||||
focusedAfterDelay = false
|
||||
}
|
||||
val aspectRatio = dto?.primaryImageAspectRatio?.toFloat() ?: AspectRatios.TALL
|
||||
val aspectRatio = item?.aspectRatio ?: AspectRatios.TALL
|
||||
val width = imageHeight * aspectRatio
|
||||
val height = imageWidth * (1f / aspectRatio)
|
||||
Column(
|
||||
|
|
|
|||
|
|
@ -113,8 +113,7 @@ fun BannerItemRow(
|
|||
name = title,
|
||||
item = item,
|
||||
aspectRatio =
|
||||
aspectRatioOverride ?: item?.data?.primaryImageAspectRatio?.toFloat()
|
||||
?: AspectRatios.WIDE,
|
||||
aspectRatioOverride ?: item?.aspectRatio ?: AspectRatios.WIDE,
|
||||
cornerText = item?.data?.indexNumber?.let { "E$it" },
|
||||
played = item?.data?.userData?.played ?: false,
|
||||
playPercent = item?.data?.userData?.playedPercentage ?: 0.0,
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ fun SeasonCard(
|
|||
imageWidth: Dp = Dp.Unspecified,
|
||||
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
|
||||
showImageOverlay: Boolean = false,
|
||||
aspectRatio: Float = item?.data?.primaryImageAspectRatio?.toFloat() ?: AspectRatios.TALL,
|
||||
aspectRatio: Float = item?.aspectRatio ?: AspectRatios.TALL,
|
||||
) {
|
||||
val imageUrlService = LocalImageUrlService.current
|
||||
val density = LocalDensity.current
|
||||
|
|
|
|||
|
|
@ -218,9 +218,7 @@ fun SeriesOverviewContent(
|
|||
item = episode,
|
||||
aspectRatio =
|
||||
episode
|
||||
?.data
|
||||
?.primaryImageAspectRatio
|
||||
?.toFloat()
|
||||
?.aspectRatio
|
||||
?.coerceAtLeast(AspectRatios.FOUR_THREE)
|
||||
?: (AspectRatios.WIDE),
|
||||
cornerText = cornerText,
|
||||
|
|
|
|||
|
|
@ -473,9 +473,7 @@ fun PlaybackPage(
|
|||
).joinToString(" - "),
|
||||
description = it.data.overview,
|
||||
imageUrl = LocalImageUrlService.current.rememberImageUrl(it),
|
||||
aspectRatio =
|
||||
it.data.primaryImageAspectRatio?.toFloat()
|
||||
?: AspectRatios.WIDE,
|
||||
aspectRatio = it.aspectRatio ?: AspectRatios.WIDE,
|
||||
onClick = {
|
||||
viewModel.reportInteraction()
|
||||
viewModel.playNextUp()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue