diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-09-02 08:19:29 +0200 |
|---|---|---|
| committer | Anthony Lavado <anthonylavado@users.noreply.github.com> | 2019-09-02 02:19:29 -0400 |
| commit | ee637e8fecbcefe429babbbbd1325bce7c3fe991 (patch) | |
| tree | e3d76fb8d753dd43d8d0cff16e199b706ba84980 /MediaBrowser.Controller/Entities/BaseItem.cs | |
| parent | cb393c215a2ea75f61d0e3e798c6a4a596d720c2 (diff) | |
Fix warnings, improve performance (#1665)
* Fix warnings, improve performance
`QueryResult.Items` is now a `IReadOnlyList` so we don't need to
allocate a new `Array` when we have a `List` (and `Items` shouldn't need to
be mutable anyway)
* Update Providers .csproj to latest C#
* Remove extra newline from DtoService.cs
* Remove extra newline from UserLibraryService.cs
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 38e4db3cf..0e9f7ee44 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -2871,16 +2871,16 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the remote trailers. /// </summary> /// <value>The remote trailers.</value> - public MediaUrl[] RemoteTrailers { get; set; } + public IReadOnlyList<MediaUrl> RemoteTrailers { get; set; } public IEnumerable<BaseItem> GetExtras() { return ExtraIds.Select(LibraryManager.GetItemById).Where(i => i != null).OrderBy(i => i.SortName); } - public IEnumerable<BaseItem> GetExtras(ExtraType[] extraTypes) + public IEnumerable<BaseItem> GetExtras(IReadOnlyCollection<ExtraType> extraTypes) { - return ExtraIds.Select(LibraryManager.GetItemById).Where(i => i != null && extraTypes.Contains(i.ExtraType.Value)).OrderBy(i => i.SortName); + return ExtraIds.Select(LibraryManager.GetItemById).Where(i => i != null && extraTypes.Contains(i.ExtraType.Value)); } public IEnumerable<BaseItem> GetTrailers() @@ -2908,7 +2908,7 @@ namespace MediaBrowser.Controller.Entities } // Possible types of extra videos - public static ExtraType[] DisplayExtraTypes = new[] { Model.Entities.ExtraType.BehindTheScenes, Model.Entities.ExtraType.Clip, Model.Entities.ExtraType.DeletedScene, Model.Entities.ExtraType.Interview, Model.Entities.ExtraType.Sample, Model.Entities.ExtraType.Scene }; + public static readonly IReadOnlyCollection<ExtraType> DisplayExtraTypes = new[] { Model.Entities.ExtraType.BehindTheScenes, Model.Entities.ExtraType.Clip, Model.Entities.ExtraType.DeletedScene, Model.Entities.ExtraType.Interview, Model.Entities.ExtraType.Sample, Model.Entities.ExtraType.Scene }; public virtual bool SupportsExternalTransfer => false; } |
