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.
This commit is contained in:
Justin Visser 2026-05-26 11:40:49 +02:00
parent 9fc46a80b4
commit 3060887756

View file

@ -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 {