mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Apply suggestions from code review
Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
parent
be72001ff9
commit
477b922e4a
@ -1761,8 +1761,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(videoStream.VideoRangeType)
|
if (!requestedRangeTypes.Contains(videoStream.VideoRangeType, StringComparison.OrdinalIgnoreCase))
|
||||||
&& !requestedRangeTypes.Contains(videoStream.VideoRangeType, StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1867,7 +1867,7 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
// change from split by | to comma
|
// change from split by | to comma
|
||||||
// strip spaces to avoid having to encode
|
// strip spaces to avoid having to encode
|
||||||
var values = value
|
var values = value
|
||||||
.Split('|', StringSplitOptions.RemoveEmptyEntries);
|
.Split('|', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||||
|
|
||||||
if (condition.Condition == ProfileConditionType.Equals)
|
if (condition.Condition == ProfileConditionType.Equals)
|
||||||
{
|
{
|
||||||
@ -1876,7 +1876,7 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
else if (condition.Condition == ProfileConditionType.EqualsAny)
|
else if (condition.Condition == ProfileConditionType.EqualsAny)
|
||||||
{
|
{
|
||||||
var currentValue = item.GetOption(qualifier, "rangetype");
|
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);
|
item.SetOption(qualifier, "rangetype", currentValue);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ namespace MediaBrowser.Model.Dlna
|
|||||||
}
|
}
|
||||||
|
|
||||||
var targetVideoCodecs = TargetVideoCodec;
|
var targetVideoCodecs = TargetVideoCodec;
|
||||||
var videoCodec = targetVideoCodecs.Length == 0 ? null : targetVideoCodecs[0];
|
var videoCodec = targetVideoCodecs.FirstOrDefault();
|
||||||
if (!string.IsNullOrEmpty(videoCodec))
|
if (!string.IsNullOrEmpty(videoCodec))
|
||||||
{
|
{
|
||||||
return GetOption(videoCodec, "rangetype");
|
return GetOption(videoCodec, "rangetype");
|
||||||
|
@ -104,7 +104,7 @@ namespace MediaBrowser.Model.Entities
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var (videoRange, videoRangeType) = getVideoColorRange();
|
var (videoRange, _) = GetVideoColorRange();
|
||||||
|
|
||||||
return videoRange;
|
return videoRange;
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ namespace MediaBrowser.Model.Entities
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var (videoRange, videoRangeType) = getVideoColorRange();
|
var (_, videoRangeType) = GetVideoColorRange();
|
||||||
|
|
||||||
return videoRangeType;
|
return videoRangeType;
|
||||||
}
|
}
|
||||||
@ -563,7 +563,7 @@ namespace MediaBrowser.Model.Entities
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public (string VideoRange, string VideoRangeType) getVideoColorRange()
|
public (string VideoRange, string VideoRangeType) GetVideoColorRange()
|
||||||
{
|
{
|
||||||
if (Type != MediaStreamType.Video)
|
if (Type != MediaStreamType.Video)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user