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:
Justin Visser 2026-05-26 14:10:44 +02:00
parent f9c0da2e08
commit 9f90885b4c
2 changed files with 20 additions and 4 deletions

View file

@ -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(),

View file

@ -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,
)
},
)