aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Entities/Folder.cs
diff options
context:
space:
mode:
authorLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-09 14:32:51 -0400
committerLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-09 14:32:51 -0400
commitc1c4c85fc250ce76d91a2afbda06c13173a06ec6 (patch)
tree391836aa25c2565813303b837803b3765c49cd26 /MediaBrowser.Model/Entities/Folder.cs
parentfd9ba20451604013f11ee657cd3c460b78e678fe (diff)
Added some favorites api calls
Diffstat (limited to 'MediaBrowser.Model/Entities/Folder.cs')
-rw-r--r--MediaBrowser.Model/Entities/Folder.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Entities/Folder.cs b/MediaBrowser.Model/Entities/Folder.cs
index ed3a38088..ec37107c3 100644
--- a/MediaBrowser.Model/Entities/Folder.cs
+++ b/MediaBrowser.Model/Entities/Folder.cs
@@ -97,6 +97,24 @@ namespace MediaBrowser.Model.Entities
}
/// <summary>
+ /// Finds all recursive items within a top-level parent that the user has marked as a favorite
+ /// </summary>
+ public IEnumerable<BaseItem> GetFavoriteItems(User user)
+ {
+ return GetParentalAllowedRecursiveChildren(user).Where(c =>
+ {
+ UserItemData data = c.GetUserData(user);
+
+ if (data != null)
+ {
+ return data.IsFavorite;
+ }
+
+ return false;
+ });
+ }
+
+ /// <summary>
/// Finds all recursive items within a top-level parent that contain the given person and are allowed for the current user
/// </summary>
public IEnumerable<BaseItem> GetItemsWithPerson(string person, User user)