mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +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
|
@Transient
|
||||||
val indexNumber = data.indexNumber ?: dateAsIndex()
|
val indexNumber = data.indexNumber ?: dateAsIndex()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ fun EpisodeCard(
|
||||||
} else {
|
} else {
|
||||||
focusedAfterDelay = false
|
focusedAfterDelay = false
|
||||||
}
|
}
|
||||||
val aspectRatio = dto?.primaryImageAspectRatio?.toFloat() ?: AspectRatios.TALL
|
val aspectRatio = item?.aspectRatio ?: AspectRatios.TALL
|
||||||
val width = imageHeight * aspectRatio
|
val width = imageHeight * aspectRatio
|
||||||
val height = imageWidth * (1f / aspectRatio)
|
val height = imageWidth * (1f / aspectRatio)
|
||||||
Column(
|
Column(
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,7 @@ fun BannerItemRow(
|
||||||
name = title,
|
name = title,
|
||||||
item = item,
|
item = item,
|
||||||
aspectRatio =
|
aspectRatio =
|
||||||
aspectRatioOverride ?: item?.data?.primaryImageAspectRatio?.toFloat()
|
aspectRatioOverride ?: item?.aspectRatio ?: AspectRatios.WIDE,
|
||||||
?: AspectRatios.WIDE,
|
|
||||||
cornerText = item?.data?.indexNumber?.let { "E$it" },
|
cornerText = item?.data?.indexNumber?.let { "E$it" },
|
||||||
played = item?.data?.userData?.played ?: false,
|
played = item?.data?.userData?.played ?: false,
|
||||||
playPercent = item?.data?.userData?.playedPercentage ?: 0.0,
|
playPercent = item?.data?.userData?.playedPercentage ?: 0.0,
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ fun SeasonCard(
|
||||||
imageWidth: Dp = Dp.Unspecified,
|
imageWidth: Dp = Dp.Unspecified,
|
||||||
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
|
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
|
||||||
showImageOverlay: Boolean = false,
|
showImageOverlay: Boolean = false,
|
||||||
aspectRatio: Float = item?.data?.primaryImageAspectRatio?.toFloat() ?: AspectRatios.TALL,
|
aspectRatio: Float = item?.aspectRatio ?: AspectRatios.TALL,
|
||||||
) {
|
) {
|
||||||
val imageUrlService = LocalImageUrlService.current
|
val imageUrlService = LocalImageUrlService.current
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
|
|
|
||||||
|
|
@ -218,9 +218,7 @@ fun SeriesOverviewContent(
|
||||||
item = episode,
|
item = episode,
|
||||||
aspectRatio =
|
aspectRatio =
|
||||||
episode
|
episode
|
||||||
?.data
|
?.aspectRatio
|
||||||
?.primaryImageAspectRatio
|
|
||||||
?.toFloat()
|
|
||||||
?.coerceAtLeast(AspectRatios.FOUR_THREE)
|
?.coerceAtLeast(AspectRatios.FOUR_THREE)
|
||||||
?: (AspectRatios.WIDE),
|
?: (AspectRatios.WIDE),
|
||||||
cornerText = cornerText,
|
cornerText = cornerText,
|
||||||
|
|
|
||||||
|
|
@ -473,9 +473,7 @@ fun PlaybackPage(
|
||||||
).joinToString(" - "),
|
).joinToString(" - "),
|
||||||
description = it.data.overview,
|
description = it.data.overview,
|
||||||
imageUrl = LocalImageUrlService.current.rememberImageUrl(it),
|
imageUrl = LocalImageUrlService.current.rememberImageUrl(it),
|
||||||
aspectRatio =
|
aspectRatio = it.aspectRatio ?: AspectRatios.WIDE,
|
||||||
it.data.primaryImageAspectRatio?.toFloat()
|
|
||||||
?: AspectRatios.WIDE,
|
|
||||||
onClick = {
|
onClick = {
|
||||||
viewModel.reportInteraction()
|
viewModel.reportInteraction()
|
||||||
viewModel.playNextUp()
|
viewModel.playNextUp()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue