diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs
index c483a4bb72..9263a574b8 100644
--- a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs
+++ b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs
@@ -147,6 +147,15 @@ namespace MediaBrowser.Api.UserLibrary
items = items.Where(i => GetLibraryItems(i, libraryItems).All(l => l.IsUnplayed(user)));
}
+ if (request.IsPlayed.HasValue)
+ {
+ var val = request.IsPlayed.Value;
+
+ var libraryItems = user.RootFolder.GetRecursiveChildren(user).ToList();
+
+ items = items.Where(i => GetLibraryItems(i, libraryItems).All(l => l.IsPlayed(user) == val));
+ }
+
return items;
}
diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs
index 9c8157c9c0..f1fe904f36 100644
--- a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs
+++ b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs
@@ -93,6 +93,9 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "SortBy", Description = "Optional. Specify one or more sort orders, comma delimeted. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
public string SortBy { get; set; }
+ [ApiMember(Name = "IsPlayed", Description = "Optional filter by items that are played, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
+ public bool? IsPlayed { get; set; }
+
///
/// Gets the filters.
///
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs
index 7f80f75acf..278821f52b 100644
--- a/MediaBrowser.Api/UserLibrary/ItemsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs
@@ -216,6 +216,9 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "IsYearMismatched", Description = "Optional filter by items that are potentially misidentified.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool? IsYearMismatched { get; set; }
+
+ [ApiMember(Name = "IsInBoxSet", Description = "Optional filter by items that are in boxsets, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
+ public bool? IsInBoxSet { get; set; }
}
///
@@ -969,6 +972,8 @@ namespace MediaBrowser.Api.UserLibrary
if (request.HasParentalRating.HasValue)
{
+ var val = request.HasParentalRating.Value;
+
items = items.Where(i =>
{
var rating = i.CustomRating;
@@ -978,7 +983,7 @@ namespace MediaBrowser.Api.UserLibrary
rating = i.OfficialRating;
}
- if (request.HasParentalRating.Value)
+ if (val)
{
return !string.IsNullOrEmpty(rating);
}
@@ -993,6 +998,18 @@ namespace MediaBrowser.Api.UserLibrary
items = items.OfType