The Free Software Media System - Server Backend & API
Fix partial set of MediaBrowser.Controller/Entities warnings
Rich Landera7cc77e7fa2b
diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.csindex fe1bc62aba..4fd6cb24ca 100644--- a/MediaBrowser.Controller/Entities/AggregateFolder.cs+++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs@@ -1,6 +1,6 @@#nullable disable-#pragma warning disable CS1591+#pragma warning disable CA1819, CS1591using System;using System.Collections.Concurrent;@@ -23,6 +23,9 @@ namespace MediaBrowser.Controller.Entitiespublic class AggregateFolder : Folder{private bool _requiresRefresh;+ private Guid[] _childrenIds = null;+ private readonly object _childIdsLock = new object();+public AggregateFolder(){@@ -32,11 +35,6 @@ namespace MediaBrowser.Controller.Entities[JsonIgnore]public override bool IsPhysicalRoot => true;- public override bool CanDelete()- {- return false;- }-[JsonIgnore]public override bool SupportsPlayedStatus => false;@@ -55,15 +53,17 @@ namespace MediaBrowser.Controller.Entitiespublic override string[] PhysicalLocations => PhysicalLocationsList;public string[] PhysicalLocationsList { get; set; }+ public override bool CanDelete()+ {+ return false;+ }+protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService){return CreateResolveArgs(directoryService, true).FileSystemChildren;}- private Guid[] _childrenIds = null;- private readonly object _childIdsLock = new object();-protected override List<BaseItem> LoadChildren(){lock (_childIdsLock)diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.csindex 6587eefab7..1bc99e8a79 100644--- a/MediaBrowser.Controller/Entities/Folder.cs+++ b/MediaBrowser.Controller/Entities/Folder.cs@@ -1,6 +1,6 @@#nullable disable-#pragma warning disable CS1591+#pragma warning disable CA1721, CA1819, CS1591using System;using System.Collections.Generic;diff --git a/MediaBrowser.Controller/Entities/ICollectionFolder.cs b/MediaBrowser.Controller/Entities/ICollectionFolder.csindex 2304570fd7..89e494ebc3 100644--- a/MediaBrowser.Controller/Entities/ICollectionFolder.cs+++ b/MediaBrowser.Controller/Entities/ICollectionFolder.cs@@ -1,6 +1,6 @@#nullable disable-#pragma warning disable CS1591+#pragma warning disable CA1819, CS1591using System;diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.csindex ebaf5506d6..3462eeb638 100644--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs@@ -1,4 +1,4 @@-#pragma warning disable CS1591+#pragma warning disable CA1819, CA2227, CS1591using System;using System.Collections.Generic;@@ -12,6 +12,15 @@ namespace MediaBrowser.Controller.Entities{public class InternalItemsQuery{+ public InternalItemsQuery(User? user)+ : this()+ {+ if (user != null)+ {+ SetUser(user);+ }+ }+public bool Recursive { get; set; }public int? StartIndex { get; set; }@@ -186,23 +195,6 @@ namespace MediaBrowser.Controller.Entitiespublic Guid[] TopParentIds { get; set; }- public BaseItem? Parent- {- set- {- if (value == null)- {- ParentId = Guid.Empty;- ParentType = null;- }- else- {- ParentId = value.Id;- ParentType = value.GetType().Name;- }- }- }-public string[] PresetViews { get; set; }public TrailerType[] TrailerTypes { get; set; }@@ -270,6 +262,23 @@ namespace MediaBrowser.Controller.Entities/// </summary>public bool? DisplayAlbumFolders { get; set; }+ public BaseItem? Parent+ {+ set+ {+ if (value == null)+ {+ ParentId = Guid.Empty;+ ParentType = null;+ }+ else+ {+ ParentId = value.Id;+ ParentType = value.GetType().Name;+ }+ }+ }+public InternalItemsQuery(){AlbumArtistIds = Array.Empty<Guid>();@@ -310,15 +319,6 @@ namespace MediaBrowser.Controller.EntitiesYears = Array.Empty<int>();}- public InternalItemsQuery(User? user)- : this()- {- if (user != null)- {- SetUser(user);- }- }-public void SetUser(User user){MaxParentalRating = user.MaxParentalAgeRating;diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.csindex b0ab280af4..b5b94ea7a4 100644--- a/MediaBrowser.Controller/Entities/Person.cs+++ b/MediaBrowser.Controller/Entities/Person.cs@@ -16,6 +16,20 @@ namespace MediaBrowser.Controller.Entities/// </summary>public class Person : BaseItem, IItemByName, IHasLookupInfo<PersonLookupInfo>{+ /// <summary>+ /// Gets the folder containing the item.+ /// If the item is a folder, it returns the folder itself.+ /// </summary>+ /// <value>The containing folder path.</value>+ [JsonIgnore]+ public override string ContainingFolderPath => Path;++ /// <summary>+ /// Gets a value indicating whether to enable alpha numeric sorting.+ /// </summary>+ [JsonIgnore]+ public override bool EnableAlphaNumericSorting => false;+public override List<string> GetUserDataKeys(){var list = base.GetUserDataKeys();@@ -49,14 +63,6 @@ namespace MediaBrowser.Controller.Entitiesreturn LibraryManager.GetItemList(query);}- /// <summary>- /// Gets the folder containing the item.- /// If the item is a folder, it returns the folder itself.- /// </summary>- /// <value>The containing folder path.</value>- [JsonIgnore]- public override string ContainingFolderPath => Path;-public override bool CanDelete(){return false;@@ -67,12 +73,6 @@ namespace MediaBrowser.Controller.Entitiesreturn true;}- /// <summary>- /// Gets a value indicating whether to enable alpha numeric sorting.- /// </summary>- [JsonIgnore]- public override bool EnableAlphaNumericSorting => false;-[JsonIgnore]public override bool SupportsPeople => false;diff --git a/MediaBrowser.Controller/Entities/PersonInfo.cs b/MediaBrowser.Controller/Entities/PersonInfo.csindex fb79323f8f..2b689ae7e2 100644--- a/MediaBrowser.Controller/Entities/PersonInfo.cs+++ b/MediaBrowser.Controller/Entities/PersonInfo.cs@@ -1,6 +1,6 @@#nullable disable-#pragma warning disable CS1591+#pragma warning disable CA2227, CS1591using System;using System.Collections.Generic;diff --git a/MediaBrowser.Controller/Entities/Photo.cs b/MediaBrowser.Controller/Entities/Photo.csindex 3312a0e3e2..ba6ce189ac 100644--- a/MediaBrowser.Controller/Entities/Photo.cs+++ b/MediaBrowser.Controller/Entities/Photo.cs@@ -36,6 +36,30 @@ namespace MediaBrowser.Controller.Entities}}+ public string CameraMake { get; set; }++ public string CameraModel { get; set; }++ public string Software { get; set; }++ public double? ExposureTime { get; set; }++ public double? FocalLength { get; set; }++ public ImageOrientation? Orientation { get; set; }++ public double? Aperture { get; set; }++ public double? ShutterSpeed { get; set; }++ public double? Latitude { get; set; }++ public double? Longitude { get; set; }++ public double? Altitude { get; set; }++ public int? IsoSpeedRating { get; set; }+public override bool CanDownload(){return true;@@ -69,29 +93,5 @@ namespace MediaBrowser.Controller.Entitiesreturn base.GetDefaultPrimaryImageAspectRatio();}-- public string CameraMake { get; set; }-- public string CameraModel { get; set; }-- public string Software { get; set; }-- public double? ExposureTime { get; set; }-- public double? FocalLength { get; set; }-- public ImageOrientation? Orientation { get; set; }-- public double? Aperture { get; set; }-- public double? ShutterSpeed { get; set; }-- public double? Latitude { get; set; }-- public double? Longitude { get; set; }-- public double? Altitude { get; set; }-- public int? IsoSpeedRating { get; set; }}}diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.csindex 888b300012..556624e14e 100644--- a/MediaBrowser.Controller/Entities/Studio.cs+++ b/MediaBrowser.Controller/Entities/Studio.cs@@ -15,19 +15,6 @@ namespace MediaBrowser.Controller.Entities/// </summary>public class Studio : BaseItem, IItemByName{- public override List<string> GetUserDataKeys()- {- var list = base.GetUserDataKeys();-- list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());- return list;- }-- public override string CreatePresentationUniqueKey()- {- return GetUserDataKeys()[0];- }-/// <summary>/// Gets the folder containing the item./// If the item is a folder, it returns the folder itself.@@ -42,6 +29,22 @@ namespace MediaBrowser.Controller.Entities[JsonIgnore]public override bool SupportsAncestors => false;+ [JsonIgnore]+ public override bool SupportsPeople => false;++ public override List<string> GetUserDataKeys()+ {+ var list = base.GetUserDataKeys();++ list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());+ return list;+ }++ public override string CreatePresentationUniqueKey()+ {+ return GetUserDataKeys()[0];+ }+public override double GetDefaultPrimaryImageAspectRatio(){double value = 16;@@ -67,9 +70,6 @@ namespace MediaBrowser.Controller.Entitiesreturn LibraryManager.GetItemList(query);}- [JsonIgnore]- public override bool SupportsPeople => false;-public static string GetPath(string name){return GetPath(name, true);diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.csindex 732b45521b..1c558d4196 100644--- a/MediaBrowser.Controller/Entities/Trailer.cs+++ b/MediaBrowser.Controller/Entities/Trailer.cs@@ -1,6 +1,6 @@#nullable disable-#pragma warning disable CS1591+#pragma warning disable CA1819, CS1591using System;using System.Collections.Generic;@@ -23,6 +23,9 @@ namespace MediaBrowser.Controller.EntitiesTrailerTypes = Array.Empty<TrailerType>();}+ [JsonIgnore]+ public override bool StopRefreshIfLocalMetadataFound => false;+public TrailerType[] TrailerTypes { get; set; }public override double GetDefaultPrimaryImageAspectRatio()@@ -97,8 +100,5 @@ namespace MediaBrowser.Controller.Entitiesreturn list;}-- [JsonIgnore]- public override bool StopRefreshIfLocalMetadataFound => false;}}diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.csindex f268bc939e..abb91cb31b 100644--- a/MediaBrowser.Controller/Entities/Year.cs+++ b/MediaBrowser.Controller/Entities/Year.cs@@ -15,6 +15,17 @@ namespace MediaBrowser.Controller.Entities/// </summary>public class Year : BaseItem, IItemByName{+ [JsonIgnore]+ public override bool SupportsAncestors => false;++ public override bool CanDelete()+ {+ return false;+ }++ [JsonIgnore]+ public override bool SupportsPeople => false;+public override List<string> GetUserDataKeys(){var list = base.GetUserDataKeys();@@ -39,14 +50,6 @@ namespace MediaBrowser.Controller.Entitiesreturn value;}- [JsonIgnore]- public override bool SupportsAncestors => false;-- public override bool CanDelete()- {- return false;- }-public override bool IsSaveLocalMetadataEnabled(){return true;@@ -76,9 +79,6 @@ namespace MediaBrowser.Controller.Entitiesreturn null;}- [JsonIgnore]- public override bool SupportsPeople => false;-public static string GetPath(string name){return GetPath(name, true);diff --git a/MediaBrowser.Controller/Providers/IDirectoryService.cs b/MediaBrowser.Controller/Providers/IDirectoryService.csindex b1a36e1024..c26a87d7d6 100644--- a/MediaBrowser.Controller/Providers/IDirectoryService.cs+++ b/MediaBrowser.Controller/Providers/IDirectoryService.cs@@ -1,4 +1,4 @@-#pragma warning disable CS1591+#pragma warning disable CA1819, CS1591using System.Collections.Generic;using MediaBrowser.Model.IO;