mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-20 06:30:57 +01:00
Use Array.Empty
This commit is contained in:
@@ -206,7 +206,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
}
|
||||
|
||||
return new MediaFormatProfile[] { };
|
||||
return Array.Empty<MediaFormatProfile>();
|
||||
}
|
||||
|
||||
private MediaFormatProfile ValueOf(string value)
|
||||
|
||||
@@ -813,18 +813,18 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
var stream = TargetAudioStream;
|
||||
|
||||
string inputCodec = stream == null ? null : stream.Codec;
|
||||
string inputCodec = stream?.Codec;
|
||||
|
||||
if (IsDirectStream)
|
||||
{
|
||||
return string.IsNullOrEmpty(inputCodec) ? new string[] { } : new[] { inputCodec };
|
||||
return string.IsNullOrEmpty(inputCodec) ? Array.Empty<string>() : new[] { inputCodec };
|
||||
}
|
||||
|
||||
foreach (string codec in AudioCodecs)
|
||||
{
|
||||
if (string.Equals(codec, inputCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return string.IsNullOrEmpty(codec) ? new string[] { } : new[] { codec };
|
||||
return string.IsNullOrEmpty(codec) ? Array.Empty<string>() : new[] { codec };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -838,18 +838,18 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
var stream = TargetVideoStream;
|
||||
|
||||
string inputCodec = stream == null ? null : stream.Codec;
|
||||
string inputCodec = stream?.Codec;
|
||||
|
||||
if (IsDirectStream)
|
||||
{
|
||||
return string.IsNullOrEmpty(inputCodec) ? new string[] { } : new[] { inputCodec };
|
||||
return string.IsNullOrEmpty(inputCodec) ? Array.Empty<string>() : new[] { inputCodec };
|
||||
}
|
||||
|
||||
foreach (string codec in VideoCodecs)
|
||||
{
|
||||
if (string.Equals(codec, inputCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return string.IsNullOrEmpty(codec) ? new string[] { } : new[] { codec };
|
||||
return string.IsNullOrEmpty(codec) ? Array.Empty<string>() : new[] { codec };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Model.Querying
|
||||
@@ -54,7 +55,7 @@ namespace MediaBrowser.Model.Querying
|
||||
|
||||
public UpcomingEpisodesQuery()
|
||||
{
|
||||
EnableImageTypes = new ImageType[] { };
|
||||
EnableImageTypes = Array.Empty<ImageType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user