Clamp PlaybackSpeed values instead of erroring

This commit is contained in:
rzk3 2023-02-16 10:04:58 -05:00
parent bb840a2e70
commit 750feaf693
2 changed files with 12 additions and 4 deletions

View File

@ -126,9 +126,13 @@ namespace MediaBrowser.Model.Session
set
{
if (value > 10 || value < 0.1)
if (value > 10)
{
throw new InvalidOperationException("PlaybackSpeed must be between 0.1 and 10.0");
_playbackSpeed = 10;
}
else if (value < 0.1)
{
_playbackSpeed = 0.1;
}
_playbackSpeed = value;

View File

@ -88,9 +88,13 @@ namespace MediaBrowser.Model.Session
set
{
if (value > 10 || value < 0.1)
if (value > 10)
{
throw new InvalidOperationException("PlaybackSpeed must be between 0.1 and 10.0");
_playbackSpeed = 10;
}
else if (value < 0.1)
{
_playbackSpeed = 0.1;
}
_playbackSpeed = value;