The Free Software Media System - Server Backend & API
Use Array.Empty
Patrick Barron6d1b00da648e
diff --git a/Emby.Dlna/Profiles/DefaultProfile.cs b/Emby.Dlna/Profiles/DefaultProfile.csindex 2347ebd0d3..90a23a4a22 100644--- a/Emby.Dlna/Profiles/DefaultProfile.cs+++ b/Emby.Dlna/Profiles/DefaultProfile.cs@@ -164,7 +164,7 @@ namespace Emby.Dlna.Profilespublic void AddXmlRootAttribute(string name, string value){- var atts = XmlRootAttributes ?? new XmlAttribute[] { };+ var atts = XmlRootAttributes ?? System.Array.Empty<XmlAttribute>();var list = atts.ToList();list.Add(new XmlAttributediff --git a/Emby.Dlna/Profiles/DenonAvrProfile.cs b/Emby.Dlna/Profiles/DenonAvrProfile.csindex 73a87c499e..a5ba0f36cc 100644--- a/Emby.Dlna/Profiles/DenonAvrProfile.cs+++ b/Emby.Dlna/Profiles/DenonAvrProfile.cs@@ -28,7 +28,7 @@ namespace Emby.Dlna.Profiles},};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = System.Array.Empty<ResponseProfile>();}}}diff --git a/Emby.Dlna/Profiles/DirectTvProfile.cs b/Emby.Dlna/Profiles/DirectTvProfile.csindex 5ca388167b..f6f98b07d8 100644--- a/Emby.Dlna/Profiles/DirectTvProfile.cs+++ b/Emby.Dlna/Profiles/DirectTvProfile.cs@@ -123,7 +123,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = System.Array.Empty<ResponseProfile>();}}}diff --git a/Emby.Dlna/Profiles/Foobar2000Profile.cs b/Emby.Dlna/Profiles/Foobar2000Profile.csindex ea3de686a6..68e959770a 100644--- a/Emby.Dlna/Profiles/Foobar2000Profile.cs+++ b/Emby.Dlna/Profiles/Foobar2000Profile.cs@@ -72,7 +72,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = System.Array.Empty<ResponseProfile>();}}}diff --git a/Emby.Dlna/Profiles/MarantzProfile.cs b/Emby.Dlna/Profiles/MarantzProfile.csindex 6cfcc3b824..24078ab29c 100644--- a/Emby.Dlna/Profiles/MarantzProfile.cs+++ b/Emby.Dlna/Profiles/MarantzProfile.cs@@ -37,7 +37,7 @@ namespace Emby.Dlna.Profiles},};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = System.Array.Empty<ResponseProfile>();}}}diff --git a/Emby.Dlna/Profiles/MediaMonkeyProfile.cs b/Emby.Dlna/Profiles/MediaMonkeyProfile.csindex 7161af7386..28d639b6db 100644--- a/Emby.Dlna/Profiles/MediaMonkeyProfile.cs+++ b/Emby.Dlna/Profiles/MediaMonkeyProfile.cs@@ -1,5 +1,6 @@#pragma warning disable CS1591+using System;using MediaBrowser.Model.Dlna;namespace Emby.Dlna.Profiles@@ -37,7 +38,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = Array.Empty<ResponseProfile>();}}}diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2013.csindex 42b066d52b..238fe9f6bc 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2013.cs@@ -1,5 +1,6 @@#pragma warning disable CS1591+using System;using MediaBrowser.Model.Dlna;namespace Emby.Dlna.Profiles@@ -223,7 +224,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = Array.Empty<ResponseProfile>();}}}diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2014.csindex fbdf2c18e8..812a481513 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2014.cs@@ -1,5 +1,6 @@#pragma warning disable CS1591+using System;using MediaBrowser.Model.Dlna;namespace Emby.Dlna.Profiles@@ -223,7 +224,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = Array.Empty<ResponseProfile>();}}}diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2015.csindex ce32179a1b..6bfff322ef 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2015.cs@@ -1,5 +1,6 @@#pragma warning disable CS1591+using System;using MediaBrowser.Model.Dlna;namespace Emby.Dlna.Profiles@@ -211,7 +212,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = Array.Empty<ResponseProfile>();}}}diff --git a/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs b/Emby.Dlna/Profiles/SonyBlurayPlayer2016.csindex aa1721d398..ec2529574c 100644--- a/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs+++ b/Emby.Dlna/Profiles/SonyBlurayPlayer2016.cs@@ -1,5 +1,6 @@#pragma warning disable CS1591+using System;using MediaBrowser.Model.Dlna;namespace Emby.Dlna.Profiles@@ -211,7 +212,7 @@ namespace Emby.Dlna.Profiles}};- ResponseProfiles = new ResponseProfile[] { };+ ResponseProfiles = Array.Empty<ResponseProfile>();}}}diff --git a/MediaBrowser.Api/FilterService.cs b/MediaBrowser.Api/FilterService.csindex 1b736c77da..dcfdcbfed3 100644--- a/MediaBrowser.Api/FilterService.cs+++ b/MediaBrowser.Api/FilterService.cs@@ -125,7 +125,7 @@ namespace MediaBrowser.ApiIncludeItemTypes = request.GetIncludeItemTypes(),DtoOptions = new Controller.Dto.DtoOptions{- Fields = new ItemFields[] { },+ Fields = Array.Empty<ItemFields>(),EnableImages = false,EnableUserData = false},diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex 25933bc909..90f62e153b 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -613,7 +613,7 @@ namespace MediaBrowser.Controller.Entities{if (!IsFileProtocol){- return new string[] { };+ return Array.Empty<string>();}return new[] { Path };diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.csindex 70c48b6f1a..c131c5430a 100644--- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs+++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs@@ -198,7 +198,7 @@ namespace MediaBrowser.Controller.Entities.Moviespublic Guid[] GetLibraryFolderIds(){- var expandedFolders = new List<Guid>() { };+ var expandedFolders = new List<Guid>();return FlattenItems(this, expandedFolders).SelectMany(i => LibraryManager.GetCollectionFolders(i))diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.csindex fc9b3f1c6e..a3aa6019ec 100644--- a/MediaBrowser.Controller/Library/TVUtils.cs+++ b/MediaBrowser.Controller/Library/TVUtils.cs@@ -38,7 +38,7 @@ namespace MediaBrowser.Controller.Library};}- return new DayOfWeek[] { };+ return Array.Empty<DayOfWeek>();}return null;diff --git a/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs b/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.csindex e6359f4fbe..ccfae2fa54 100644--- a/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs+++ b/MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs@@ -41,7 +41,7 @@ namespace MediaBrowser.MediaEncoding.BdInfovar outputStream = new BlurayDiscInfo{- MediaStreams = new MediaStream[] { }+ MediaStreams = Array.Empty<MediaStream>()};if (playlist == null)diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.csindex 3f21c2bd40..c85d963ed1 100644--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs@@ -1008,7 +1008,7 @@ namespace MediaBrowser.MediaEncoding.Probingvar artist = FFProbeHelpers.GetDictionaryValue(tags, "artist");if (string.IsNullOrWhiteSpace(artist)){- audio.Artists = new string[] { };+ audio.Artists = Array.Empty<string>();}else{@@ -1031,7 +1031,7 @@ namespace MediaBrowser.MediaEncoding.Probingif (string.IsNullOrWhiteSpace(albumArtist)){- audio.AlbumArtists = new string[] { };+ audio.AlbumArtists = Array.Empty<string>();}else{diff --git a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.csindex 398c5db8c8..bdc5f8bb78 100644--- a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs+++ b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs@@ -206,7 +206,7 @@ namespace MediaBrowser.Model.Dlna}}- return new MediaFormatProfile[] { };+ return Array.Empty<MediaFormatProfile>();}private MediaFormatProfile ValueOf(string value)diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.csindex b89e9ce90a..8d7554e881 100644--- a/MediaBrowser.Model/Dlna/StreamInfo.cs+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs@@ -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 };}}diff --git a/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs b/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.csindex 12d537492a..2ef6f7c60b 100644--- a/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs+++ b/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs@@ -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.Queryingpublic UpcomingEpisodesQuery(){- EnableImageTypes = new ImageType[] { };+ EnableImageTypes = Array.Empty<ImageType>();}}}diff --git a/MediaBrowser.Providers/Manager/MetadataService.cs b/MediaBrowser.Providers/Manager/MetadataService.csindex ecfa3d46dd..3b0c7b56ca 100644--- a/MediaBrowser.Providers/Manager/MetadataService.cs+++ b/MediaBrowser.Providers/Manager/MetadataService.cs@@ -723,7 +723,7 @@ namespace MediaBrowser.Providers.ManageruserDataList.AddRange(localItem.UserDataList);}- MergeData(localItem, temp, new MetadataField[] { }, !options.ReplaceAllMetadata, true);+ MergeData(localItem, temp, Array.Empty<MetadataField>(), !options.ReplaceAllMetadata, true);refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;// Only one local provider allowed per item@@ -849,7 +849,7 @@ namespace MediaBrowser.Providers.Manager{result.Provider = provider.Name;- MergeData(result, temp, new MetadataField[] { }, false, false);+ MergeData(result, temp, Array.Empty<MetadataField>(), false, false);MergeNewData(temp.Item, id);refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataDownload;