mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-06-29 10:23:36 +02:00
Use ternary conditional operator
This commit is contained in:
parent
5161fbc67a
commit
914faa6679
|
@ -148,22 +148,8 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||||
/// <value>The playback speed.</value>
|
/// <value>The playback speed.</value>
|
||||||
public double? PlaybackSpeed
|
public double? PlaybackSpeed
|
||||||
{
|
{
|
||||||
get
|
get => _playbackSpeed;
|
||||||
{
|
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
|
||||||
return _playbackSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value is null)
|
|
||||||
{
|
|
||||||
_playbackSpeed = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -119,22 +119,8 @@ namespace MediaBrowser.Model.Session
|
||||||
/// <value>The playback speed.</value>
|
/// <value>The playback speed.</value>
|
||||||
public double? PlaybackSpeed
|
public double? PlaybackSpeed
|
||||||
{
|
{
|
||||||
get
|
get => _playbackSpeed;
|
||||||
{
|
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
|
||||||
return _playbackSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value is null)
|
|
||||||
{
|
|
||||||
_playbackSpeed = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,22 +81,8 @@ namespace MediaBrowser.Model.Session
|
||||||
/// <value>The playback speed.</value>
|
/// <value>The playback speed.</value>
|
||||||
public double? PlaybackSpeed
|
public double? PlaybackSpeed
|
||||||
{
|
{
|
||||||
get
|
get => _playbackSpeed;
|
||||||
{
|
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
|
||||||
return _playbackSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value is null)
|
|
||||||
{
|
|
||||||
_playbackSpeed = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue