diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index e0a3069e7c..d5b0aca3c3 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1761,8 +1761,7 @@ namespace MediaBrowser.Controller.MediaEncoding return false; } - if (!string.IsNullOrEmpty(videoStream.VideoRangeType) - && !requestedRangeTypes.Contains(videoStream.VideoRangeType, StringComparison.OrdinalIgnoreCase)) + if (!requestedRangeTypes.Contains(videoStream.VideoRangeType, StringComparison.OrdinalIgnoreCase)) { return false; } diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index bfab185342..fdb9fd5d54 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -1867,7 +1867,7 @@ namespace MediaBrowser.Model.Dlna // change from split by | to comma // strip spaces to avoid having to encode var values = value - .Split('|', StringSplitOptions.RemoveEmptyEntries); + .Split('|', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); if (condition.Condition == ProfileConditionType.Equals) { @@ -1876,7 +1876,7 @@ namespace MediaBrowser.Model.Dlna else if (condition.Condition == ProfileConditionType.EqualsAny) { var currentValue = item.GetOption(qualifier, "rangetype"); - if (!string.IsNullOrEmpty(currentValue) && values.Any(value => value == currentValue)) + if (!string.IsNullOrEmpty(currentValue) && values.Any(v => string.Equals(v, currentValue, StringComparison.OrdinalIgnoreCase))) { item.SetOption(qualifier, "rangetype", currentValue); } diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index 0c66351c70..4fcc54a038 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -293,7 +293,7 @@ namespace MediaBrowser.Model.Dlna } var targetVideoCodecs = TargetVideoCodec; - var videoCodec = targetVideoCodecs.Length == 0 ? null : targetVideoCodecs[0]; + var videoCodec = targetVideoCodecs.FirstOrDefault(); if (!string.IsNullOrEmpty(videoCodec)) { return GetOption(videoCodec, "rangetype"); diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 46a481092e..48408e5847 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -104,7 +104,7 @@ namespace MediaBrowser.Model.Entities { get { - var (videoRange, videoRangeType) = getVideoColorRange(); + var (videoRange, _) = GetVideoColorRange(); return videoRange; } @@ -118,7 +118,7 @@ namespace MediaBrowser.Model.Entities { get { - var (videoRange, videoRangeType) = getVideoColorRange(); + var (_, videoRangeType) = GetVideoColorRange(); return videoRangeType; } @@ -563,7 +563,7 @@ namespace MediaBrowser.Model.Entities return true; } - public (string VideoRange, string VideoRangeType) getVideoColorRange() + public (string VideoRange, string VideoRangeType) GetVideoColorRange() { if (Type != MediaStreamType.Video) {