diff options
| author | crobibero <cody@robibe.ro> | 2020-11-12 08:29:42 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-11-12 08:29:42 -0700 |
| commit | 73f9a6d7d057a9fd0a3ab24a52bd82e768f39705 (patch) | |
| tree | 5dc3d9bb108b12440747197f8667e2d63c7c80d1 /Jellyfin.Api/Extensions | |
| parent | 00c4055b6e6125eb2a1d04b6432f171caef1b0da (diff) | |
Convert array property to IReadOnlyList
Diffstat (limited to 'Jellyfin.Api/Extensions')
| -rw-r--r-- | Jellyfin.Api/Extensions/DtoExtensions.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Jellyfin.Api/Extensions/DtoExtensions.cs b/Jellyfin.Api/Extensions/DtoExtensions.cs index 6dee9db38..f2abd515d 100644 --- a/Jellyfin.Api/Extensions/DtoExtensions.cs +++ b/Jellyfin.Api/Extensions/DtoExtensions.cs @@ -1,6 +1,8 @@ using System; +using System.Collections.Generic; using System.Linq; using Jellyfin.Api.Helpers; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; @@ -43,7 +45,7 @@ namespace Jellyfin.Api.Extensions client.IndexOf("media center", StringComparison.OrdinalIgnoreCase) != -1 || client.IndexOf("classic", StringComparison.OrdinalIgnoreCase) != -1) { - int oldLen = dtoOptions.Fields.Length; + int oldLen = dtoOptions.Fields.Count; var arr = new ItemFields[oldLen + 1]; dtoOptions.Fields.CopyTo(arr, 0); arr[oldLen] = ItemFields.RecursiveItemCount; @@ -61,7 +63,7 @@ namespace Jellyfin.Api.Extensions client.IndexOf("samsung", StringComparison.OrdinalIgnoreCase) != -1 || client.IndexOf("androidtv", StringComparison.OrdinalIgnoreCase) != -1) { - int oldLen = dtoOptions.Fields.Length; + int oldLen = dtoOptions.Fields.Count; var arr = new ItemFields[oldLen + 1]; dtoOptions.Fields.CopyTo(arr, 0); arr[oldLen] = ItemFields.ChildCount; @@ -90,7 +92,7 @@ namespace Jellyfin.Api.Extensions bool? enableImages, bool? enableUserData, int? imageTypeLimit, - ImageType[] enableImageTypes) + IReadOnlyList<ImageType> enableImageTypes) { dtoOptions.EnableImages = enableImages ?? true; @@ -104,7 +106,7 @@ namespace Jellyfin.Api.Extensions dtoOptions.EnableUserData = enableUserData.Value; } - if (enableImageTypes.Length != 0) + if (enableImageTypes.Count != 0) { dtoOptions.ImageTypes = enableImageTypes; } |
