mirror of https://github.com/jellyfin/jellyfin.git
Round PlaybackSpeed to nearest tenth
This commit is contained in:
parent
6d13c95e84
commit
0549b86982
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue