diff options
Diffstat (limited to 'MediaBrowser.Model/Entities')
| -rw-r--r-- | MediaBrowser.Model/Entities/BaseItem.cs | 23 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/Folder.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/IHasProviderIds.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/ItemSpecialCounts.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/VirtualFolder.cs | 8 |
5 files changed, 33 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Entities/BaseItem.cs b/MediaBrowser.Model/Entities/BaseItem.cs index 506c051c52..7d3663fb23 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 105151f315..50ce9d45ef 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 3406d618bd..8b9852dda3 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 9add9fe99e..8dd9a2fbd9 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 0000000000..f25db3e41b --- /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; }
+ }
+}
|
