瀏覽代碼

Missed some stuff

Bond_009 4 年之前
父節點
當前提交
ff49a3bb61

+ 1 - 1
DvdLib/Ifo/Dvd.cs

@@ -31,7 +31,7 @@ namespace DvdLib.Ifo
                         continue;
                     }
 
-                    var nums = ifo.Name.Split(new[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
+                    var nums = ifo.Name.Split('_', StringSplitOptions.RemoveEmptyEntries);
                     if (nums.Length >= 2 && ushort.TryParse(nums[1], out var ifoNumber))
                     {
                         ReadVTS(ifoNumber, ifo.FullName);

+ 1 - 1
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -2705,7 +2705,7 @@ namespace Emby.Server.Implementations.Library
 
             var videos = videoListResolver.Resolve(fileSystemChildren);
 
-            var currentVideo = videos.FirstOrDefault(i => string.Equals(owner.Path, i.Files.First().Path, StringComparison.OrdinalIgnoreCase));
+            var currentVideo = videos.FirstOrDefault(i => string.Equals(owner.Path, i.Files[0].Path, StringComparison.OrdinalIgnoreCase));
 
             if (currentVideo != null)
             {

+ 1 - 1
Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs

@@ -201,7 +201,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
                     continue;
                 }
 
-                var firstMedia = resolvedItem.Files.First();
+                var firstMedia = resolvedItem.Files[0];
 
                 var libraryItem = new T
                 {

+ 1 - 1
Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs

@@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
                 try
                 {
                     previouslyFailedImages = File.ReadAllText(failHistoryPath)
-                        .Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
+                        .Split('|', StringSplitOptions.RemoveEmptyEntries)
                         .ToList();
                 }
                 catch (IOException)

+ 3 - 3
Jellyfin.Api/Controllers/FilterController.cs

@@ -78,8 +78,8 @@ namespace Jellyfin.Api.Controllers
             var query = new InternalItemsQuery
             {
                 User = user,
-                MediaTypes = (mediaTypes ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
-                IncludeItemTypes = (includeItemTypes ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
+                MediaTypes = (mediaTypes ?? string.Empty).Split(',', StringSplitOptions.RemoveEmptyEntries),
+                IncludeItemTypes = (includeItemTypes ?? string.Empty).Split(',', StringSplitOptions.RemoveEmptyEntries),
                 Recursive = true,
                 EnableTotalRecordCount = false,
                 DtoOptions = new DtoOptions
@@ -168,7 +168,7 @@ namespace Jellyfin.Api.Controllers
             var genreQuery = new InternalItemsQuery(user)
             {
                 IncludeItemTypes =
-                    (includeItemTypes ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
+                    (includeItemTypes ?? string.Empty).Split(',', StringSplitOptions.RemoveEmptyEntries),
                 DtoOptions = new DtoOptions
                 {
                     Fields = Array.Empty<ItemFields>(),

+ 2 - 2
MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs

@@ -149,7 +149,7 @@ namespace MediaBrowser.MediaEncoding.Probing
                 var iTunEXTC = FFProbeHelpers.GetDictionaryValue(tags, "iTunEXTC");
                 if (!string.IsNullOrWhiteSpace(iTunEXTC))
                 {
-                    var parts = iTunEXTC.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
+                    var parts = iTunEXTC.Split('|', StringSplitOptions.RemoveEmptyEntries);
                     // Example
                     // mpaa|G|100|For crude humor
                     if (parts.Length > 1)
@@ -1139,7 +1139,7 @@ namespace MediaBrowser.MediaEncoding.Probing
                 return null;
             }
 
-            return value.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries)
+            return value.Split('/', StringSplitOptions.RemoveEmptyEntries)
                 .Select(i => i.Trim())
                 .FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
         }

+ 1 - 1
MediaBrowser.Model/Dlna/ContainerProfile.cs

@@ -34,7 +34,7 @@ namespace MediaBrowser.Model.Dlna
                 return Array.Empty<string>();
             }
 
-            return value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+            return value.Split(',', StringSplitOptions.RemoveEmptyEntries);
         }
 
         public bool ContainsContainer(string container)

+ 1 - 1
MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs

@@ -186,7 +186,7 @@ namespace MediaBrowser.Model.Dlna
 
             if (mediaProfile != null && !string.IsNullOrEmpty(mediaProfile.OrgPn))
             {
-                orgPnValues.AddRange(mediaProfile.OrgPn.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
+                orgPnValues.AddRange(mediaProfile.OrgPn.Split(',', StringSplitOptions.RemoveEmptyEntries));
             }
             else
             {

+ 1 - 1
MediaBrowser.Model/Dlna/StreamBuilder.cs

@@ -1647,7 +1647,7 @@ namespace MediaBrowser.Model.Dlna
 
                                 // strip spaces to avoid having to encode
                                 var values = value
-                                    .Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
+                                    .Split('|', StringSplitOptions.RemoveEmptyEntries);
 
                                 if (condition.Condition == ProfileConditionType.Equals || condition.Condition == ProfileConditionType.EqualsAny)
                                 {

+ 1 - 1
MediaBrowser.Providers/Plugins/Omdb/OmdbProvider.cs

@@ -391,7 +391,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
                 item.Genres = Array.Empty<string>();
 
                 foreach (var genre in result.Genre
-                    .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
+                    .Split(',', StringSplitOptions.RemoveEmptyEntries)
                     .Select(i => i.Trim())
                     .Where(i => !string.IsNullOrWhiteSpace(i)))
                 {

+ 1 - 1
MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesProvider.cs

@@ -170,7 +170,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
                 _logger.LogError(e, "Failed to retrieve series with remote id {RemoteId}", id);
             }
 
-            return result?.Data.First().Id.ToString();
+            return result?.Data[0].Id.ToString(CultureInfo.InvariantCulture);
         }
 
         /// <summary>

+ 4 - 4
RSSDP/HttpParserBase.cs

@@ -119,7 +119,7 @@ namespace Rssdp.Infrastructure
             }
             else
             {
-                headersToAddTo.TryAddWithoutValidation(headerName, values.First());
+                headersToAddTo.TryAddWithoutValidation(headerName, values[0]);
             }
         }
 
@@ -151,7 +151,7 @@ namespace Rssdp.Infrastructure
             return lineIndex;
         }
 
-        private IList<string> ParseValues(string headerValue)
+        private List<string> ParseValues(string headerValue)
         {
             // This really should be better and match the HTTP 1.1 spec,
             // but this should actually be good enough for SSDP implementations
@@ -160,7 +160,7 @@ namespace Rssdp.Infrastructure
 
             if (headerValue == "\"\"")
             {
-                values.Add(String.Empty);
+                values.Add(string.Empty);
                 return values;
             }
 
@@ -172,7 +172,7 @@ namespace Rssdp.Infrastructure
             else
             {
                 var segments = headerValue.Split(SeparatorCharacters);
-                if (headerValue.Contains("\""))
+                if (headerValue.Contains('"'))
                 {
                     for (int segmentIndex = 0; segmentIndex < segments.Length; segmentIndex++)
                     {