mirror of https://github.com/jellyfin/jellyfin.git
Fix more warnings
This commit is contained in:
parent
a16e66615c
commit
0ce7a15534
|
@ -22,25 +22,19 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AggregateFolder : Folder
|
public class AggregateFolder : Folder
|
||||||
{
|
{
|
||||||
private bool _requiresRefresh;
|
|
||||||
private Guid[] _childrenIds = null;
|
|
||||||
private readonly object _childIdsLock = new object();
|
private readonly object _childIdsLock = new object();
|
||||||
|
|
||||||
public AggregateFolder()
|
|
||||||
{
|
|
||||||
PhysicalLocationsList = Array.Empty<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool IsPhysicalRoot => true;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsPlayedStatus => false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _virtual children.
|
/// The _virtual children.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ConcurrentBag<BaseItem> _virtualChildren = new ConcurrentBag<BaseItem>();
|
private readonly ConcurrentBag<BaseItem> _virtualChildren = new ConcurrentBag<BaseItem>();
|
||||||
|
private bool _requiresRefresh;
|
||||||
|
private Guid[] _childrenIds = null;
|
||||||
|
|
||||||
|
public AggregateFolder()
|
||||||
|
{
|
||||||
|
PhysicalLocationsList = Array.Empty<string>();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the virtual children.
|
/// Gets the virtual children.
|
||||||
|
@ -48,10 +42,17 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// <value>The virtual children.</value>
|
/// <value>The virtual children.</value>
|
||||||
public ConcurrentBag<BaseItem> VirtualChildren => _virtualChildren;
|
public ConcurrentBag<BaseItem> VirtualChildren => _virtualChildren;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool IsPhysicalRoot => true;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsPlayedStatus => false;
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override string[] PhysicalLocations => PhysicalLocationsList;
|
public override string[] PhysicalLocations => PhysicalLocationsList;
|
||||||
|
|
||||||
public string[] PhysicalLocationsList { get; set; }
|
public string[] PhysicalLocationsList { get; set; }
|
||||||
|
|
||||||
public override bool CanDelete()
|
public override bool CanDelete()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -167,7 +168,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// Adds the virtual child.
|
/// Adds the virtual child.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="child">The child.</param>
|
/// <param name="child">The child.</param>
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
/// <exception cref="ArgumentNullException">Throws if child is null.</exception>
|
||||||
public void AddVirtualChild(BaseItem child)
|
public void AddVirtualChild(BaseItem child)
|
||||||
{
|
{
|
||||||
if (child == null)
|
if (child == null)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CA1002, CA1724, CA1826, CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -25,6 +25,12 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
IHasLookupInfo<SongInfo>,
|
IHasLookupInfo<SongInfo>,
|
||||||
IHasMediaSources
|
IHasMediaSources
|
||||||
{
|
{
|
||||||
|
public Audio()
|
||||||
|
{
|
||||||
|
Artists = Array.Empty<string>();
|
||||||
|
AlbumArtists = Array.Empty<string>();
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public IReadOnlyList<string> Artists { get; set; }
|
public IReadOnlyList<string> Artists { get; set; }
|
||||||
|
@ -33,17 +39,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public IReadOnlyList<string> AlbumArtists { get; set; }
|
public IReadOnlyList<string> AlbumArtists { get; set; }
|
||||||
|
|
||||||
public Audio()
|
|
||||||
{
|
|
||||||
Artists = Array.Empty<string>();
|
|
||||||
AlbumArtists = Array.Empty<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override double GetDefaultPrimaryImageAspectRatio()
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsPlayedStatus => true;
|
public override bool SupportsPlayedStatus => true;
|
||||||
|
|
||||||
|
@ -62,11 +57,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override Folder LatestItemsIndexContainer => AlbumEntity;
|
public override Folder LatestItemsIndexContainer => AlbumEntity;
|
||||||
|
|
||||||
public override bool CanDownload()
|
|
||||||
{
|
|
||||||
return IsFileProtocol;
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public MusicAlbum AlbumEntity => FindParent<MusicAlbum>();
|
public MusicAlbum AlbumEntity => FindParent<MusicAlbum>();
|
||||||
|
|
||||||
|
@ -77,6 +67,16 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override string MediaType => Model.Entities.MediaType.Audio;
|
public override string MediaType => Model.Entities.MediaType.Audio;
|
||||||
|
|
||||||
|
public override double GetDefaultPrimaryImageAspectRatio()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool CanDownload()
|
||||||
|
{
|
||||||
|
return IsFileProtocol;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the name of the sort.
|
/// Creates the name of the sort.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CA1819, CS1591
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities.Audio
|
namespace MediaBrowser.Controller.Entities.Audio
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CA1721, CA1826, CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -23,18 +23,18 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo>, IMetadataContainer
|
public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo>, IMetadataContainer
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
|
||||||
public IReadOnlyList<string> AlbumArtists { get; set; }
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public IReadOnlyList<string> Artists { get; set; }
|
|
||||||
|
|
||||||
public MusicAlbum()
|
public MusicAlbum()
|
||||||
{
|
{
|
||||||
Artists = Array.Empty<string>();
|
Artists = Array.Empty<string>();
|
||||||
AlbumArtists = Array.Empty<string>();
|
AlbumArtists = Array.Empty<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IReadOnlyList<string> AlbumArtists { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IReadOnlyList<string> Artists { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsAddingToPlaylist => true;
|
public override bool SupportsAddingToPlaylist => true;
|
||||||
|
|
||||||
|
@ -44,6 +44,25 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public MusicArtist MusicArtist => GetMusicArtist(new DtoOptions(true));
|
public MusicArtist MusicArtist => GetMusicArtist(new DtoOptions(true));
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsPlayedStatus => false;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsCumulativeRunTimeTicks => true;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public string AlbumArtist => AlbumArtists.FirstOrDefault();
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsPeople => false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the tracks.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The tracks.</value>
|
||||||
|
[JsonIgnore]
|
||||||
|
public IEnumerable<Audio> Tracks => GetRecursiveChildren(i => i is Audio).Cast<Audio>();
|
||||||
|
|
||||||
public MusicArtist GetMusicArtist(DtoOptions options)
|
public MusicArtist GetMusicArtist(DtoOptions options)
|
||||||
{
|
{
|
||||||
var parents = GetParents();
|
var parents = GetParents();
|
||||||
|
@ -64,25 +83,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsPlayedStatus => false;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsCumulativeRunTimeTicks => true;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public string AlbumArtist => AlbumArtists.FirstOrDefault();
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsPeople => false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the tracks.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The tracks.</value>
|
|
||||||
[JsonIgnore]
|
|
||||||
public IEnumerable<Audio> Tracks => GetRecursiveChildren(i => i is Audio).Cast<Audio>();
|
|
||||||
|
|
||||||
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
|
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
|
||||||
{
|
{
|
||||||
return Tracks;
|
return Tracks;
|
||||||
|
|
|
@ -44,6 +44,36 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsPlayedStatus => false;
|
public override bool SupportsPlayedStatus => false;
|
||||||
|
|
||||||
|
/// <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;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override IEnumerable<BaseItem> Children
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (IsAccessedByName)
|
||||||
|
{
|
||||||
|
return new List<BaseItem>();
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.Children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsPeople => false;
|
||||||
|
|
||||||
|
public static string GetPath(string name)
|
||||||
|
{
|
||||||
|
return GetPath(name, true);
|
||||||
|
}
|
||||||
|
|
||||||
public override double GetDefaultPrimaryImageAspectRatio()
|
public override double GetDefaultPrimaryImageAspectRatio()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -65,20 +95,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
return LibraryManager.GetItemList(query);
|
return LibraryManager.GetItemList(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override IEnumerable<BaseItem> Children
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (IsAccessedByName)
|
|
||||||
{
|
|
||||||
return new List<BaseItem>();
|
|
||||||
}
|
|
||||||
|
|
||||||
return base.Children;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetChildCount(User user)
|
public override int GetChildCount(User user)
|
||||||
{
|
{
|
||||||
return IsAccessedByName ? 0 : base.GetChildCount(user);
|
return IsAccessedByName ? 0 : base.GetChildCount(user);
|
||||||
|
@ -113,14 +129,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <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>
|
/// <summary>
|
||||||
/// Gets the user data key.
|
/// Gets the user data key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -167,14 +175,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsPeople => false;
|
|
||||||
|
|
||||||
public static string GetPath(string name)
|
|
||||||
{
|
|
||||||
return GetPath(name, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetPath(string name, bool normalizeName)
|
public static string GetPath(string name, bool normalizeName)
|
||||||
{
|
{
|
||||||
// Trim the period at the end because windows will have a hard time with that
|
// Trim the period at the end because windows will have a hard time with that
|
||||||
|
@ -208,6 +208,8 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="replaceAllMetadata">Option to replace metadata.</param>
|
||||||
|
/// <returns>True if metadata changed.</returns>
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
|
@ -15,19 +15,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MusicGenre : BaseItem, IItemByName
|
public class MusicGenre : 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];
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsAddingToPlaylist => true;
|
public override bool SupportsAddingToPlaylist => true;
|
||||||
|
|
||||||
|
@ -45,6 +32,22 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override string ContainingFolderPath => Path;
|
public override string ContainingFolderPath => Path;
|
||||||
|
|
||||||
|
[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()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -60,9 +63,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsPeople => false;
|
|
||||||
|
|
||||||
public IList<BaseItem> GetTaggedItems(InternalItemsQuery query)
|
public IList<BaseItem> GetTaggedItems(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
query.GenreIds = new[] { Id };
|
query.GenreIds = new[] { Id };
|
||||||
|
@ -106,6 +106,8 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="replaceAllMetadata">Option to replace metadata.</param>
|
||||||
|
/// <returns>True if metadata changed.</returns>
|
||||||
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
|
||||||
{
|
{
|
||||||
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetadata);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CA1724, CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
#pragma warning disable CA1721, CA1819, CS1591
|
#pragma warning disable CA1002, CA1721, CA1819, CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -165,6 +165,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ICollectionManager CollectionManager { get; set; }
|
||||||
|
|
||||||
public override bool CanDelete()
|
public override bool CanDelete()
|
||||||
{
|
{
|
||||||
if (IsRoot)
|
if (IsRoot)
|
||||||
|
@ -258,6 +260,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// Loads our children. Validation will occur externally.
|
/// Loads our children. Validation will occur externally.
|
||||||
/// We want this synchronous.
|
/// We want this synchronous.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <returns>Returns cached children</returns>
|
||||||
protected virtual List<BaseItem> LoadChildren()
|
protected virtual List<BaseItem> LoadChildren()
|
||||||
{
|
{
|
||||||
// logger.LogDebug("Loading children from {0} {1} {2}", GetType().Name, Id, Path);
|
// logger.LogDebug("Loading children from {0} {1} {2}", GetType().Name, Id, Path);
|
||||||
|
@ -642,6 +645,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// Get the children of this folder from the actual file system.
|
/// Get the children of this folder from the actual file system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||||
|
/// <param name="directoryService">The directory service to use for operation.</param>
|
||||||
|
/// <returns>Returns set of base items.</returns>
|
||||||
protected virtual IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
|
protected virtual IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
|
||||||
{
|
{
|
||||||
var collectionType = LibraryManager.GetContentType(this);
|
var collectionType = LibraryManager.GetContentType(this);
|
||||||
|
@ -998,8 +1003,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return PostFilterAndSort(items, query, true);
|
return PostFilterAndSort(items, query, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ICollectionManager CollectionManager { get; set; }
|
|
||||||
|
|
||||||
protected QueryResult<BaseItem> PostFilterAndSort(IEnumerable<BaseItem> items, InternalItemsQuery query, bool enableSorting)
|
protected QueryResult<BaseItem> PostFilterAndSort(IEnumerable<BaseItem> items, InternalItemsQuery query, bool enableSorting)
|
||||||
{
|
{
|
||||||
var user = query.User;
|
var user = query.User;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CA1819, CS1591
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma warning disable CA1819, CA2227, CS1591
|
#pragma warning disable CA1044, CA1819, CA2227, CS1591
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -12,6 +12,46 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
public class InternalItemsQuery
|
public class InternalItemsQuery
|
||||||
{
|
{
|
||||||
|
public InternalItemsQuery()
|
||||||
|
{
|
||||||
|
AlbumArtistIds = Array.Empty<Guid>();
|
||||||
|
AlbumIds = Array.Empty<Guid>();
|
||||||
|
AncestorIds = Array.Empty<Guid>();
|
||||||
|
ArtistIds = Array.Empty<Guid>();
|
||||||
|
BlockUnratedItems = Array.Empty<UnratedItem>();
|
||||||
|
BoxSetLibraryFolders = Array.Empty<Guid>();
|
||||||
|
ChannelIds = Array.Empty<Guid>();
|
||||||
|
ContributingArtistIds = Array.Empty<Guid>();
|
||||||
|
DtoOptions = new DtoOptions();
|
||||||
|
EnableTotalRecordCount = true;
|
||||||
|
ExcludeArtistIds = Array.Empty<Guid>();
|
||||||
|
ExcludeInheritedTags = Array.Empty<string>();
|
||||||
|
ExcludeItemIds = Array.Empty<Guid>();
|
||||||
|
ExcludeItemTypes = Array.Empty<string>();
|
||||||
|
ExcludeTags = Array.Empty<string>();
|
||||||
|
GenreIds = Array.Empty<Guid>();
|
||||||
|
Genres = Array.Empty<string>();
|
||||||
|
GroupByPresentationUniqueKey = true;
|
||||||
|
ImageTypes = Array.Empty<ImageType>();
|
||||||
|
IncludeItemTypes = Array.Empty<string>();
|
||||||
|
ItemIds = Array.Empty<Guid>();
|
||||||
|
MediaTypes = Array.Empty<string>();
|
||||||
|
MinSimilarityScore = 20;
|
||||||
|
OfficialRatings = Array.Empty<string>();
|
||||||
|
OrderBy = Array.Empty<ValueTuple<string, SortOrder>>();
|
||||||
|
PersonIds = Array.Empty<Guid>();
|
||||||
|
PersonTypes = Array.Empty<string>();
|
||||||
|
PresetViews = Array.Empty<string>();
|
||||||
|
SeriesStatuses = Array.Empty<SeriesStatus>();
|
||||||
|
SourceTypes = Array.Empty<SourceType>();
|
||||||
|
StudioIds = Array.Empty<Guid>();
|
||||||
|
Tags = Array.Empty<string>();
|
||||||
|
TopParentIds = Array.Empty<Guid>();
|
||||||
|
TrailerTypes = Array.Empty<TrailerType>();
|
||||||
|
VideoTypes = Array.Empty<VideoType>();
|
||||||
|
Years = Array.Empty<int>();
|
||||||
|
}
|
||||||
|
|
||||||
public InternalItemsQuery(User? user)
|
public InternalItemsQuery(User? user)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
|
@ -279,63 +319,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public InternalItemsQuery()
|
|
||||||
{
|
|
||||||
AlbumArtistIds = Array.Empty<Guid>();
|
|
||||||
AlbumIds = Array.Empty<Guid>();
|
|
||||||
AncestorIds = Array.Empty<Guid>();
|
|
||||||
ArtistIds = Array.Empty<Guid>();
|
|
||||||
BlockUnratedItems = Array.Empty<UnratedItem>();
|
|
||||||
BoxSetLibraryFolders = Array.Empty<Guid>();
|
|
||||||
ChannelIds = Array.Empty<Guid>();
|
|
||||||
ContributingArtistIds = Array.Empty<Guid>();
|
|
||||||
DtoOptions = new DtoOptions();
|
|
||||||
EnableTotalRecordCount = true;
|
|
||||||
ExcludeArtistIds = Array.Empty<Guid>();
|
|
||||||
ExcludeInheritedTags = Array.Empty<string>();
|
|
||||||
ExcludeItemIds = Array.Empty<Guid>();
|
|
||||||
ExcludeItemTypes = Array.Empty<string>();
|
|
||||||
ExcludeTags = Array.Empty<string>();
|
|
||||||
GenreIds = Array.Empty<Guid>();
|
|
||||||
Genres = Array.Empty<string>();
|
|
||||||
GroupByPresentationUniqueKey = true;
|
|
||||||
ImageTypes = Array.Empty<ImageType>();
|
|
||||||
IncludeItemTypes = Array.Empty<string>();
|
|
||||||
ItemIds = Array.Empty<Guid>();
|
|
||||||
MediaTypes = Array.Empty<string>();
|
|
||||||
MinSimilarityScore = 20;
|
|
||||||
OfficialRatings = Array.Empty<string>();
|
|
||||||
OrderBy = Array.Empty<ValueTuple<string, SortOrder>>();
|
|
||||||
PersonIds = Array.Empty<Guid>();
|
|
||||||
PersonTypes = Array.Empty<string>();
|
|
||||||
PresetViews = Array.Empty<string>();
|
|
||||||
SeriesStatuses = Array.Empty<SeriesStatus>();
|
|
||||||
SourceTypes = Array.Empty<SourceType>();
|
|
||||||
StudioIds = Array.Empty<Guid>();
|
|
||||||
Tags = Array.Empty<string>();
|
|
||||||
TopParentIds = Array.Empty<Guid>();
|
|
||||||
TrailerTypes = Array.Empty<TrailerType>();
|
|
||||||
VideoTypes = Array.Empty<VideoType>();
|
|
||||||
Years = Array.Empty<int>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetUser(User user)
|
|
||||||
{
|
|
||||||
MaxParentalRating = user.MaxParentalAgeRating;
|
|
||||||
|
|
||||||
if (MaxParentalRating.HasValue)
|
|
||||||
{
|
|
||||||
string other = UnratedItem.Other.ToString();
|
|
||||||
BlockUnratedItems = user.GetPreference(PreferenceKind.BlockUnratedItems)
|
|
||||||
.Where(i => i != other)
|
|
||||||
.Select(e => Enum.Parse<UnratedItem>(e, true)).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
ExcludeInheritedTags = user.GetPreference(PreferenceKind.BlockedTags);
|
|
||||||
|
|
||||||
User = user;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dictionary<string, string>? HasAnyProviderId { get; set; }
|
public Dictionary<string, string>? HasAnyProviderId { get; set; }
|
||||||
|
|
||||||
public Guid[] AlbumArtistIds { get; set; }
|
public Guid[] AlbumArtistIds { get; set; }
|
||||||
|
@ -361,5 +344,22 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public string? SearchTerm { get; set; }
|
public string? SearchTerm { get; set; }
|
||||||
|
|
||||||
public string? SeriesTimerId { get; set; }
|
public string? SeriesTimerId { get; set; }
|
||||||
|
|
||||||
|
public void SetUser(User user)
|
||||||
|
{
|
||||||
|
MaxParentalRating = user.MaxParentalAgeRating;
|
||||||
|
|
||||||
|
if (MaxParentalRating.HasValue)
|
||||||
|
{
|
||||||
|
string other = UnratedItem.Other.ToString();
|
||||||
|
BlockUnratedItems = user.GetPreference(PreferenceKind.BlockUnratedItems)
|
||||||
|
.Where(i => i != other)
|
||||||
|
.Select(e => Enum.Parse<UnratedItem>(e, true)).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
ExcludeInheritedTags = user.GetPreference(PreferenceKind.BlockedTags);
|
||||||
|
|
||||||
|
User = user;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -49,6 +49,30 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||||
/// <value>The display order.</value>
|
/// <value>The display order.</value>
|
||||||
public string DisplayOrder { get; set; }
|
public string DisplayOrder { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
private bool IsLegacyBoxSet
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(Path))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (LinkedChildren.Length > 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, Path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool IsPreSorted => true;
|
||||||
|
|
||||||
|
public Guid[] LibraryFolderIds { get; set; }
|
||||||
|
|
||||||
protected override bool GetBlockUnratedValue(User user)
|
protected override bool GetBlockUnratedValue(User user)
|
||||||
{
|
{
|
||||||
return user.GetPreferenceValues<UnratedItem>(PreferenceKind.BlockUnratedItems).Contains(UnratedItem.Movie);
|
return user.GetPreferenceValues<UnratedItem>(PreferenceKind.BlockUnratedItems).Contains(UnratedItem.Movie);
|
||||||
|
@ -83,28 +107,6 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||||
return new List<BaseItem>();
|
return new List<BaseItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
private bool IsLegacyBoxSet
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(Path))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LinkedChildren.Length > 0)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return !FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, Path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool IsPreSorted => true;
|
|
||||||
|
|
||||||
public override bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders)
|
public override bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -191,8 +193,6 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||||
return IsVisible(user);
|
return IsVisible(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Guid[] LibraryFolderIds { get; set; }
|
|
||||||
|
|
||||||
private Guid[] GetLibraryFolderIds(User user)
|
private Guid[] GetLibraryFolderIds(User user)
|
||||||
{
|
{
|
||||||
return LibraryManager.GetUserRootFolder().GetChildren(user, true)
|
return LibraryManager.GetUserRootFolder().GetChildren(user, true)
|
||||||
|
|
|
@ -30,6 +30,12 @@ namespace MediaBrowser.Controller.Entities
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool EnableAlphaNumericSorting => false;
|
public override bool EnableAlphaNumericSorting => false;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsPeople => false;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsAncestors => false;
|
||||||
|
|
||||||
public override List<string> GetUserDataKeys()
|
public override List<string> GetUserDataKeys()
|
||||||
{
|
{
|
||||||
var list = base.GetUserDataKeys();
|
var list = base.GetUserDataKeys();
|
||||||
|
@ -73,12 +79,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsPeople => false;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsAncestors => false;
|
|
||||||
|
|
||||||
public static string GetPath(string name)
|
public static string GetPath(string name)
|
||||||
{
|
{
|
||||||
return GetPath(name, true);
|
return GetPath(name, true);
|
||||||
|
|
|
@ -18,22 +18,9 @@ namespace MediaBrowser.Controller.Entities
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsAncestors => false;
|
public override bool SupportsAncestors => false;
|
||||||
|
|
||||||
public override bool CanDelete()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override bool SupportsPeople => false;
|
public override bool SupportsPeople => false;
|
||||||
|
|
||||||
public override List<string> GetUserDataKeys()
|
|
||||||
{
|
|
||||||
var list = base.GetUserDataKeys();
|
|
||||||
|
|
||||||
list.Insert(0, "Year-" + Name);
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <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,19 @@ namespace MediaBrowser.Controller.Entities
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public override string ContainingFolderPath => Path;
|
public override string ContainingFolderPath => Path;
|
||||||
|
|
||||||
|
public override bool CanDelete()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override List<string> GetUserDataKeys()
|
||||||
|
{
|
||||||
|
var list = base.GetUserDataKeys();
|
||||||
|
|
||||||
|
list.Insert(0, "Year-" + Name);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
public override double GetDefaultPrimaryImageAspectRatio()
|
public override double GetDefaultPrimaryImageAspectRatio()
|
||||||
{
|
{
|
||||||
double value = 2;
|
double value = 2;
|
||||||
|
|
Loading…
Reference in New Issue