aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Entities/BaseItem.cs23
-rw-r--r--MediaBrowser.Model/Entities/Folder.cs8
-rw-r--r--MediaBrowser.Model/Entities/IHasProviderIds.cs2
-rw-r--r--MediaBrowser.Model/Entities/ItemSpecialCounts.cs2
-rw-r--r--MediaBrowser.Model/Entities/VirtualFolder.cs8
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj1
6 files changed, 34 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Entities/BaseItem.cs b/MediaBrowser.Model/Entities/BaseItem.cs
index 506c051c5..7d3663fb2 100644
--- a/MediaBrowser.Model/Entities/BaseItem.cs
+++ b/MediaBrowser.Model/Entities/BaseItem.cs
@@ -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>
diff --git a/MediaBrowser.Model/Entities/Folder.cs b/MediaBrowser.Model/Entities/Folder.cs
index 105151f31..50ce9d45e 100644
--- a/MediaBrowser.Model/Entities/Folder.cs
+++ b/MediaBrowser.Model/Entities/Folder.cs
@@ -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>
diff --git a/MediaBrowser.Model/Entities/IHasProviderIds.cs b/MediaBrowser.Model/Entities/IHasProviderIds.cs
index 3406d618b..8b9852dda 100644
--- a/MediaBrowser.Model/Entities/IHasProviderIds.cs
+++ b/MediaBrowser.Model/Entities/IHasProviderIds.cs
@@ -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
{
diff --git a/MediaBrowser.Model/Entities/ItemSpecialCounts.cs b/MediaBrowser.Model/Entities/ItemSpecialCounts.cs
index 9add9fe99..8dd9a2fbd 100644
--- a/MediaBrowser.Model/Entities/ItemSpecialCounts.cs
+++ b/MediaBrowser.Model/Entities/ItemSpecialCounts.cs
@@ -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
{
diff --git a/MediaBrowser.Model/Entities/VirtualFolder.cs b/MediaBrowser.Model/Entities/VirtualFolder.cs
new file mode 100644
index 000000000..f25db3e41
--- /dev/null
+++ b/MediaBrowser.Model/Entities/VirtualFolder.cs
@@ -0,0 +1,8 @@
+
+namespace MediaBrowser.Model.Entities
+{
+ public class VirtualFolder : Folder
+ {
+ public string CollectionType { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 77f4403d8..60defff43 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -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" />