Fix partial set of MediaBrowser.Controller/Entities warnings

pull/6339/head
Rich Lander 3 years ago
parent 0e2a6f8216
commit a7cc77e7fa

@ -1,6 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CS1591 #pragma warning disable CA1819, CS1591
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
@ -23,6 +23,9 @@ namespace MediaBrowser.Controller.Entities
public class AggregateFolder : Folder public class AggregateFolder : Folder
{ {
private bool _requiresRefresh; private bool _requiresRefresh;
private Guid[] _childrenIds = null;
private readonly object _childIdsLock = new object();
public AggregateFolder() public AggregateFolder()
{ {
@ -32,11 +35,6 @@ namespace MediaBrowser.Controller.Entities
[JsonIgnore] [JsonIgnore]
public override bool IsPhysicalRoot => true; public override bool IsPhysicalRoot => true;
public override bool CanDelete()
{
return false;
}
[JsonIgnore] [JsonIgnore]
public override bool SupportsPlayedStatus => false; public override bool SupportsPlayedStatus => false;
@ -55,15 +53,17 @@ namespace MediaBrowser.Controller.Entities
public override string[] PhysicalLocations => PhysicalLocationsList; public override string[] PhysicalLocations => PhysicalLocationsList;
public string[] PhysicalLocationsList { get; set; } public string[] PhysicalLocationsList { get; set; }
public override bool CanDelete()
{
return false;
}
protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService) protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService)
{ {
return CreateResolveArgs(directoryService, true).FileSystemChildren; return CreateResolveArgs(directoryService, true).FileSystemChildren;
} }
private Guid[] _childrenIds = null;
private readonly object _childIdsLock = new object();
protected override List<BaseItem> LoadChildren() protected override List<BaseItem> LoadChildren()
{ {
lock (_childIdsLock) lock (_childIdsLock)

@ -1,6 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CS1591 #pragma warning disable CA1721, CA1819, CS1591
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

@ -1,6 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CS1591 #pragma warning disable CA1819, CS1591
using System; using System;

@ -1,4 +1,4 @@
#pragma warning disable CS1591 #pragma warning disable CA1819, CA2227, CS1591
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -12,6 +12,15 @@ namespace MediaBrowser.Controller.Entities
{ {
public class InternalItemsQuery public class InternalItemsQuery
{ {
public InternalItemsQuery(User? user)
: this()
{
if (user != null)
{
SetUser(user);
}
}
public bool Recursive { get; set; } public bool Recursive { get; set; }
public int? StartIndex { get; set; } public int? StartIndex { get; set; }
@ -186,23 +195,6 @@ namespace MediaBrowser.Controller.Entities
public Guid[] TopParentIds { get; set; } public 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 string[] PresetViews { get; set; }
public TrailerType[] TrailerTypes { get; set; } public TrailerType[] TrailerTypes { get; set; }
@ -270,6 +262,23 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
public bool? DisplayAlbumFolders { get; set; } 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() public InternalItemsQuery()
{ {
AlbumArtistIds = Array.Empty<Guid>(); AlbumArtistIds = Array.Empty<Guid>();
@ -310,15 +319,6 @@ namespace MediaBrowser.Controller.Entities
Years = Array.Empty<int>(); Years = Array.Empty<int>();
} }
public InternalItemsQuery(User? user)
: this()
{
if (user != null)
{
SetUser(user);
}
}
public void SetUser(User user) public void SetUser(User user)
{ {
MaxParentalRating = user.MaxParentalAgeRating; MaxParentalRating = user.MaxParentalAgeRating;

@ -16,6 +16,20 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
public class Person : BaseItem, IItemByName, IHasLookupInfo<PersonLookupInfo> 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() public override List<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys();
@ -49,14 +63,6 @@ namespace MediaBrowser.Controller.Entities
return LibraryManager.GetItemList(query); return 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() public override bool CanDelete()
{ {
return false; return false;
@ -67,12 +73,6 @@ namespace MediaBrowser.Controller.Entities
return true; return true;
} }
/// <summary>
/// Gets a value indicating whether to enable alpha numeric sorting.
/// </summary>
[JsonIgnore]
public override bool EnableAlphaNumericSorting => false;
[JsonIgnore] [JsonIgnore]
public override bool SupportsPeople => false; public override bool SupportsPeople => false;

@ -1,6 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CS1591 #pragma warning disable CA2227, CS1591
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

@ -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() public override bool CanDownload()
{ {
return true; return true;
@ -69,29 +93,5 @@ namespace MediaBrowser.Controller.Entities
return base.GetDefaultPrimaryImageAspectRatio(); return 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; }
} }
} }

@ -15,19 +15,6 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
public class Studio : BaseItem, IItemByName 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> /// <summary>
/// Gets the folder containing the item. /// Gets the folder containing the item.
/// If the item is a folder, it returns the folder itself. /// If the item is a folder, it returns the folder itself.
@ -42,6 +29,22 @@ namespace MediaBrowser.Controller.Entities
[JsonIgnore] [JsonIgnore]
public override bool SupportsAncestors => false; 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() public override double GetDefaultPrimaryImageAspectRatio()
{ {
double value = 16; double value = 16;
@ -67,9 +70,6 @@ namespace MediaBrowser.Controller.Entities
return LibraryManager.GetItemList(query); return LibraryManager.GetItemList(query);
} }
[JsonIgnore]
public override bool SupportsPeople => false;
public static string GetPath(string name) public static string GetPath(string name)
{ {
return GetPath(name, true); return GetPath(name, true);

@ -1,6 +1,6 @@
#nullable disable #nullable disable
#pragma warning disable CS1591 #pragma warning disable CA1819, CS1591
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -23,6 +23,9 @@ namespace MediaBrowser.Controller.Entities
TrailerTypes = Array.Empty<TrailerType>(); TrailerTypes = Array.Empty<TrailerType>();
} }
[JsonIgnore]
public override bool StopRefreshIfLocalMetadataFound => false;
public TrailerType[] TrailerTypes { get; set; } public TrailerType[] TrailerTypes { get; set; }
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
@ -97,8 +100,5 @@ namespace MediaBrowser.Controller.Entities
return list; return list;
} }
[JsonIgnore]
public override bool StopRefreshIfLocalMetadataFound => false;
} }
} }

@ -15,6 +15,17 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
public class Year : BaseItem, IItemByName 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() public override List<string> GetUserDataKeys()
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys();
@ -39,14 +50,6 @@ namespace MediaBrowser.Controller.Entities
return value; return value;
} }
[JsonIgnore]
public override bool SupportsAncestors => false;
public override bool CanDelete()
{
return false;
}
public override bool IsSaveLocalMetadataEnabled() public override bool IsSaveLocalMetadataEnabled()
{ {
return true; return true;
@ -76,9 +79,6 @@ namespace MediaBrowser.Controller.Entities
return null; return null;
} }
[JsonIgnore]
public override bool SupportsPeople => false;
public static string GetPath(string name) public static string GetPath(string name)
{ {
return GetPath(name, true); return GetPath(name, true);

@ -1,4 +1,4 @@
#pragma warning disable CS1591 #pragma warning disable CA1819, CS1591
using System.Collections.Generic; using System.Collections.Generic;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;

Loading…
Cancel
Save