mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 05:57:20 -04:00
Apply suggestions from code review
Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
parent
be72001ff9
commit
477b922e4a
4 changed files with 7 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue