mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-25 03:24:47 +01:00
Added a VirtualFolder entity, a resolver, and a CollectionType property.
This commit is contained in:
parent
a201eb060b
commit
a508a997d9
@@ -6,6 +6,29 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public abstract class BaseItem : BaseEntity, IHasProviderIds
|
||||
{
|
||||
/// <summary>
|
||||
/// Goes up the tree to find the virtual folder parent
|
||||
/// </summary>
|
||||
public VirtualFolder VirtualFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
var vf = this as VirtualFolder;
|
||||
|
||||
if (vf != null)
|
||||
{
|
||||
return vf;
|
||||
}
|
||||
|
||||
if (Parent != null)
|
||||
{
|
||||
return Parent.VirtualFolder;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string SortName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,14 +8,6 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public bool IsRoot { get; set; }
|
||||
|
||||
public bool IsVirtualFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return Parent != null && Parent.IsRoot;
|
||||
}
|
||||
}
|
||||
|
||||
public BaseItem[] Children { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repition using extension methods
|
||||
/// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repition by using extension methods
|
||||
/// </summary>
|
||||
public interface IHasProviderIds
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Since it can be slow to collect this data. This class helps provide a way to calculate them all at once.
|
||||
/// Since it can be slow to collect this data, this class helps provide a way to calculate them all at once.
|
||||
/// </summary>
|
||||
public class ItemSpecialCounts
|
||||
{
|
||||
|
||||
8
MediaBrowser.Model/Entities/VirtualFolder.cs
Normal file
8
MediaBrowser.Model/Entities/VirtualFolder.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public class VirtualFolder : Folder
|
||||
{
|
||||
public string CollectionType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@
|
||||
<Compile Include="Entities\Person.cs" />
|
||||
<Compile Include="Entities\Studio.cs" />
|
||||
<Compile Include="Entities\Video.cs" />
|
||||
<Compile Include="Entities\VirtualFolder.cs" />
|
||||
<Compile Include="Entities\Year.cs" />
|
||||
<Compile Include="Plugins\BasePluginConfiguration.cs" />
|
||||
<Compile Include="DTO\PluginInfo.cs" />
|
||||
|
||||
Reference in New Issue
Block a user