From 3060887756bb8585cb360dc73acacb30221bb8df Mon Sep 17 00:00:00 2001 From: Justin Visser Date: Tue, 26 May 2026 11:40:49 +0200 Subject: [PATCH] Fix Card size slider for users with legacy stored heightDp HomeRowViewOptions is serialized to the user's Jellyfin server. Existing users have rows with heightDp == 172 (the pre-PR default) persisted upstream. Without this guard, resolvedCardHeight() would treat 172 as a per-row override and the Card size slider would do nothing on the home page until the user explicitly reset their rows. Treat the legacy 172 value as "no override" so users coming from older builds see the slider take effect immediately on home rows. HEIGHT_2X3_DP is now the base value the global multiplier scales from; no preset sets heightDp to exactly 172. HEIGHT_EPISODE (128) and other preset values remain valid per-row overrides because they are not equal to 172. --- .../github/damontecres/wholphin/ui/util/InterfaceHelpers.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/util/InterfaceHelpers.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/util/InterfaceHelpers.kt index c571f392..6ce2428c 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/util/InterfaceHelpers.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/util/InterfaceHelpers.kt @@ -5,11 +5,13 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.github.damontecres.wholphin.data.model.HomeRowViewOptions import com.github.damontecres.wholphin.preferences.AppSliderPreference +import com.github.damontecres.wholphin.ui.Cards @Composable internal fun HomeRowViewOptions.resolvedCardHeight(): Dp { val global = LocalInterfaceCustomization.current.cardHeightDp - return (if (heightDp > 0) heightDp else global).dp + val isOverride = heightDp > 0 && heightDp != Cards.HEIGHT_2X3_DP + return (if (isOverride) heightDp else global).dp } internal fun Int.withinBoundsOrDefault(preference: AppSliderPreference<*>): Int {