From adfe46e3ed139b7baa323d8f17dd2c8ee0aa702c Mon Sep 17 00:00:00 2001 From: Alex Schwemler Date: Wed, 6 May 2026 20:51:58 +0200 Subject: [PATCH] feat: changed thresholdPercentage & thresholdMinutesBeforeEnd values to be more aligned with Tv version + added 0 minutes & 0% option, so auto-select starts at the end of the episode --- .../app/features/player/skip/PlayerNextEpisodeRules.kt | 4 ++-- .../nuvio/app/features/settings/PlaybackSettingsPage.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/skip/PlayerNextEpisodeRules.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/skip/PlayerNextEpisodeRules.kt index a703251d..9dd949ae 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/skip/PlayerNextEpisodeRules.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/skip/PlayerNextEpisodeRules.kt @@ -39,11 +39,11 @@ object PlayerNextEpisodeRules { if (durationMs <= 0L) return false when (thresholdMode) { NextEpisodeThresholdMode.PERCENTAGE -> { - val clampedPercent = thresholdPercent.coerceIn(97f, 99.5f) + val clampedPercent = thresholdPercent.coerceIn(97f, 100f) (positionMs.toDouble() / durationMs.toDouble()) >= (clampedPercent / 100.0) } NextEpisodeThresholdMode.MINUTES_BEFORE_END -> { - val clampedMinutes = thresholdMinutesBeforeEnd.coerceIn(1f, 3.5f) + val clampedMinutes = thresholdMinutesBeforeEnd.coerceIn(0f, 3.5f) val remainingMs = durationMs - positionMs remainingMs <= (clampedMinutes * 60_000f).toLong() } diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/settings/PlaybackSettingsPage.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/settings/PlaybackSettingsPage.kt index e51e413d..18a9c422 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/settings/PlaybackSettingsPage.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/settings/PlaybackSettingsPage.kt @@ -629,8 +629,8 @@ private fun PlaybackSettingsSection( onValueChangeFinished = { PlayerSettingsRepository.setNextEpisodeThresholdPercent(sliderValue) }, - valueRange = 50f..100f, - steps = 49, + valueRange = 97f..100f, + steps = calculateSteps(97f, 100f, 0.5f), colors = SliderDefaults.colors( thumbColor = MaterialTheme.colorScheme.primary, activeTrackColor = MaterialTheme.colorScheme.primary, @@ -682,8 +682,8 @@ private fun PlaybackSettingsSection( onValueChangeFinished = { PlayerSettingsRepository.setNextEpisodeThresholdMinutesBeforeEnd(sliderValue) }, - valueRange = 1f..15f, - steps = 13, + valueRange = 0f..3.5f, + steps = calculateSteps(0f, 3.5f, 0.5f), colors = SliderDefaults.colors( thumbColor = MaterialTheme.colorScheme.primary, activeTrackColor = MaterialTheme.colorScheme.primary,