From 9f90885b4c4a6cf2224b459b296a664f77f3bfda Mon Sep 17 00:00:00 2001 From: Justin Visser Date: Tue, 26 May 2026 14:10:44 +0200 Subject: [PATCH] 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. --- .../wholphin/ui/cards/EpisodeCard.kt | 20 +++++++++++++++++-- .../wholphin/ui/main/SearchPage.kt | 4 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/EpisodeCard.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/EpisodeCard.kt index 78080c3a..04f3170f 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/EpisodeCard.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/EpisodeCard.kt @@ -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(), diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/main/SearchPage.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/main/SearchPage.kt index 31a36b49..1ff5b468 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/main/SearchPage.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/main/SearchPage.kt @@ -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, ) }, )