Round PlaybackSpeed to nearest tenth

This commit is contained in:
rzk3 2023-03-27 10:45:00 -04:00
parent 6d13c95e84
commit 0549b86982
4 changed files with 4 additions and 4 deletions

View File

@ -149,7 +149,7 @@ namespace Emby.Server.Implementations.SyncPlay
public float? PlaybackSpeed
{
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1f, 10.0f);
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
}
/// <summary>

View File

@ -120,7 +120,7 @@ namespace MediaBrowser.Model.Session
public float? PlaybackSpeed
{
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1f, 10.0f);
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
}
}
}

View File

@ -82,7 +82,7 @@ namespace MediaBrowser.Model.Session
public float? PlaybackSpeed
{
get => _playbackSpeed;
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1f, 10.0f);
set => _playbackSpeed = value is null ? null : (float?)Math.Round(Math.Clamp(value.Value, 0.1f, 10.0f), 1);
}
}
}

View File

@ -30,7 +30,7 @@ namespace MediaBrowser.Model.SyncPlay
IsPlaying = isPlaying;
ShuffleMode = shuffleMode;
RepeatMode = repeatMode;
PlaybackSpeed = playbackSpeed is null ? null : Math.Clamp(playbackSpeed.Value, 0.1f, 10.0f);
PlaybackSpeed = playbackSpeed is null ? null : (float?)Math.Round(Math.Clamp(playbackSpeed.Value, 0.1f, 10.0f), 1);
}
/// <summary>