Added a VirtualFolder entity, a resolver, and a CollectionType property.

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-08-18 15:38:27 -04:00
parent a201eb060b
commit a508a997d9
18 changed files with 128 additions and 19 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -0,0 +1,8 @@

namespace MediaBrowser.Model.Entities
{
public class VirtualFolder : Folder
{
public string CollectionType { get; set; }
}
}

View File

@@ -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" />