diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-19 14:25:29 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-19 14:25:29 -0500 |
| commit | 7da834507838c9d5c2246bf958bdac44046de4c2 (patch) | |
| tree | 78d70010e698faa6827624fc9efa124d5ba6b8c1 | |
| parent | ccf707e57b701b236c1dcb1f12e81486ccaa1aed (diff) | |
updated nuget
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ItemsService.cs | 19 | ||||
| -rw-r--r-- | MediaBrowser.Model/Querying/ItemQuery.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Model/Querying/ItemsByNameQuery.cs | 6 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Common.Internal.nuspec | 4 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Common.nuspec | 2 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Server.Core.nuspec | 4 |
8 files changed, 45 insertions, 6 deletions
diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs index c483a4bb7..9263a574b 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 9c8157c9c..f1fe904f3 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; } + /// <summary> /// Gets the filters. /// </summary> diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 7f80f75ac..278821f52 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; } } /// <summary> @@ -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<Video>().Where(i => i.IsHD == val); } + if (request.IsInBoxSet.HasValue) + { + var val = request.IsHD.Value; + items = items.Where(i => i.Parents.OfType<BoxSet>().Any() == val); + } + + if (request.IsPlayed.HasValue) + { + var val = request.IsPlayed.Value; + items = items.Where(i => i.IsPlayed(user) == val); + } + if (request.ParentIndexNumber.HasValue) { var filterValue = request.ParentIndexNumber.Value; diff --git a/MediaBrowser.Model/Querying/ItemQuery.cs b/MediaBrowser.Model/Querying/ItemQuery.cs index afc0540ef..bc769b786 100644 --- a/MediaBrowser.Model/Querying/ItemQuery.cs +++ b/MediaBrowser.Model/Querying/ItemQuery.cs @@ -249,6 +249,10 @@ namespace MediaBrowser.Model.Querying public bool? IsUnaired { get; set; } public bool? IsVirtualUnaired { get; set; } + + public bool? IsInBoxSet { get; set; } + + public bool? IsPlayed { get; set; } /// <summary> /// Gets or sets the exclude location types. diff --git a/MediaBrowser.Model/Querying/ItemsByNameQuery.cs b/MediaBrowser.Model/Querying/ItemsByNameQuery.cs index 8d2ab50d7..eafc322ab 100644 --- a/MediaBrowser.Model/Querying/ItemsByNameQuery.cs +++ b/MediaBrowser.Model/Querying/ItemsByNameQuery.cs @@ -92,6 +92,12 @@ namespace MediaBrowser.Model.Querying public string NameLessThan { get; set; } /// <summary> + /// Gets or sets a value indicating whether this instance is played. + /// </summary> + /// <value><c>null</c> if [is played] contains no value, <c>true</c> if [is played]; otherwise, <c>false</c>.</value> + public bool? IsPlayed { get; set; } + + /// <summary> /// Initializes a new instance of the <see cref="ItemsByNameQuery" /> class. /// </summary> public ItemsByNameQuery() diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index ee0488546..8ce140e78 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common.Internal</id> - <version>3.0.305</version> + <version>3.0.306</version> <title>MediaBrowser.Common.Internal</title> <authors>Luke</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.305" /> + <dependency id="MediaBrowser.Common" version="3.0.306" /> <dependency id="NLog" version="2.1.0" /> <dependency id="SimpleInjector" version="2.4.0" /> <dependency id="sharpcompress" version="0.10.2" /> diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index c0893d26b..34a2859f6 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common</id> - <version>3.0.305</version> + <version>3.0.306</version> <title>MediaBrowser.Common</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 8feb93f2a..49121eb9b 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MediaBrowser.Server.Core</id> - <version>3.0.305</version> + <version>3.0.306</version> <title>Media Browser.Server.Core</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains core components required to build plugins for Media Browser Server.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.305" /> + <dependency id="MediaBrowser.Common" version="3.0.306" /> </dependencies> </metadata> <files> |
