mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 15:32:01 +00:00
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
This commit is contained in:
parent
7c0994d957
commit
adfe46e3ed
2 changed files with 6 additions and 6 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue