Fix edgecases for new playback speed control

This commit is contained in:
Kelvin 2025-06-07 16:44:20 +02:00
commit 8f28653b28
2 changed files with 3 additions and 3 deletions

View file

@ -2166,9 +2166,9 @@ class VideoDetailView : ConstraintLayout {
var playbackSpeedString = v; var playbackSpeedString = v;
val stepSpeed = Settings.instance.playback.getPlaybackSpeedStep(); val stepSpeed = Settings.instance.playback.getPlaybackSpeedStep();
if(v == "+") if(v == "+")
playbackSpeedString = String.format("%.2f", (currentPlaybackSpeed?.toDouble() ?: 1.0) + stepSpeed).toString(); playbackSpeedString = String.format("%.2f", Math.min((currentPlaybackSpeed?.toDouble() ?: 1.0) + stepSpeed, 5.0)).toString();
else if(v == "-") else if(v == "-")
playbackSpeedString = String.format("%.2f", (currentPlaybackSpeed?.toDouble() ?: 1.0) - stepSpeed).toString(); playbackSpeedString = String.format("%.2f", Math.max(0.1, (currentPlaybackSpeed?.toDouble() ?: 1.0) - stepSpeed)).toString();
val newPlaybackSpeed = playbackSpeedString.toDouble(); val newPlaybackSpeed = playbackSpeedString.toDouble();
if (_isCasting) { if (_isCasting) {
val ad = StateCasting.instance.activeDevice ?: return@subscribe val ad = StateCasting.instance.activeDevice ?: return@subscribe

View file

@ -90,7 +90,7 @@ class ToggleField : TableRow, IField {
val advancedFieldAttr = field.getAnnotation(AdvancedField::class.java) val advancedFieldAttr = field.getAnnotation(AdvancedField::class.java)
if(advancedFieldAttr != null || advanced) { if(advancedFieldAttr != null || advanced) {
Logger.w("ToggleField", "Found advanced field: " + field.name); Logger.w("ToggleField", "Found cccadvanced field: " + field.name);
isAdvanced = true; isAdvanced = true;
} }