mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Wire Search episode-row into the Card size slider
The actual EPISODE_ROW result row on SearchPage was missing the
LocalInterfaceCustomization.current.episodeCardHeightDp.dp read that the
adjacent ALBUM/ARTIST/SONG rows already had, so the Card size slider
did not affect Search episode results. Drop the extra
padding(horizontal = 8.dp) at the same call site so the row's
leading-edge alignment matches the other ItemRow consumers after the
horizontalPadding/cardSpacing split in 66b58ada.
Also fix EpisodeCard so the requested image size matches the rendered
card: previously imageWidth = Dp.Unspecified was being roundToPx()'d
into a junk value and passed as fillWidth, and fillHeight was never
plumbed through at all. Mirror the SeasonCard pattern - null when the
input dp is Unspecified, otherwise the pixel value - so the Jellyfin
server scales the image to the real card dimensions. Source images
that are themselves low-resolution (auto-extracted episode PRIMARY)
will still look soft when the slider is at 150%, but well-curated
episode thumbnails now render sharply.
This commit is contained in:
parent
94e2adf354
commit
908b08bd73
2 changed files with 20 additions and 4 deletions
|
|
@ -72,7 +72,22 @@ fun EpisodeCard(
|
|||
val width = imageHeight * aspectRatio
|
||||
val height = imageWidth * (1f / aspectRatio)
|
||||
val density = LocalDensity.current
|
||||
val imageWidthPx = remember(imageWidth) { with(density) { imageWidth.roundToPx() } }
|
||||
val fillWidthPx =
|
||||
remember(imageWidth, density) {
|
||||
if (imageWidth != Dp.Unspecified) {
|
||||
with(density) { imageWidth.roundToPx() }
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
val fillHeightPx =
|
||||
remember(imageHeight, density) {
|
||||
if (imageHeight != Dp.Unspecified) {
|
||||
with(density) { imageHeight.roundToPx() }
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(spaceBetween),
|
||||
modifier = modifier.size(width, height),
|
||||
|
|
@ -105,7 +120,8 @@ fun EpisodeCard(
|
|||
watchedPercent = dto?.userData?.playedPercentage,
|
||||
numberOfVersions = dto?.mediaSourceCount ?: 0,
|
||||
useFallbackText = false,
|
||||
fillWidth = imageWidthPx,
|
||||
fillWidth = fillWidthPx,
|
||||
fillHeight = fillHeightPx,
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxSize(),
|
||||
|
|
|
|||
|
|
@ -714,8 +714,8 @@ fun SearchPage(
|
|||
onClick.invoke()
|
||||
},
|
||||
onLongClick = onLongClick,
|
||||
imageHeight = 140.dp,
|
||||
modifier = mod.padding(horizontal = 8.dp),
|
||||
imageHeight = LocalInterfaceCustomization.current.episodeCardHeightDp.dp,
|
||||
modifier = mod,
|
||||
)
|
||||
},
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue