mirror of https://github.com/jellyfin/jellyfin.git
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>
|
||||
public double? PlaybackSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _playbackSpeed;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
_playbackSpeed = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
|
||||
}
|
||||
}
|
||||
get => _playbackSpeed;
|
||||
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -119,22 +119,8 @@ namespace MediaBrowser.Model.Session
|
|||
/// <value>The playback speed.</value>
|
||||
public double? PlaybackSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _playbackSpeed;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
_playbackSpeed = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
|
||||
}
|
||||
}
|
||||
get => _playbackSpeed;
|
||||
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,22 +81,8 @@ namespace MediaBrowser.Model.Session
|
|||
/// <value>The playback speed.</value>
|
||||
public double? PlaybackSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _playbackSpeed;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
_playbackSpeed = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
_playbackSpeed = Math.Clamp((double)value, 0.1, 10.0);
|
||||
}
|
||||
}
|
||||
get => _playbackSpeed;
|
||||
set => _playbackSpeed = value is null ? null : Math.Clamp(value.Value, 0.1, 10.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue