updated nuget with new query params

This commit is contained in:
Luke Pulverenti 2013-11-03 11:19:33 -05:00
parent d6055ec6fd
commit 72e96b1afb
7 changed files with 45 additions and 7 deletions

View File

@ -33,6 +33,9 @@ namespace MediaBrowser.Api.DefaultTheme
[ApiMember(Name = "RomanceGenre", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
public string RomanceGenre { get; set; }
[ApiMember(Name = "TopCommunityRating", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
public double TopCommunityRating { get; set; }
}
[Route("/MBT/DefaultTheme/Movies", "GET")]
@ -260,7 +263,14 @@ namespace MediaBrowser.Api.DefaultTheme
var seriesWithBackdrops = series.Where(i => i.BackdropImagePaths.Count > 0).ToList();
var view = new TvView();
var view = new TvView
{
SeriesCount = series.Count,
FavoriteSeriesCount = series.Count(i => _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).IsFavorite),
TopCommunityRatedSeriesCount = series.Count(i => i.CommunityRating.HasValue && i.CommunityRating.Value >= request.TopCommunityRating)
};
var fields = new List<ItemFields>();

View File

@ -40,6 +40,11 @@ namespace MediaBrowser.Api.DefaultTheme
public List<ItemStub> RomanceItems { get; set; }
public List<ItemStub> ComedyItems { get; set; }
public int SeriesCount { get; set; }
public int FavoriteSeriesCount { get; set; }
public int TopCommunityRatedSeriesCount { get; set; }
public int InProgressSeriesCount { get; set; }
}
public class GamesView : BaseView

View File

@ -196,6 +196,12 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "IsVirtualUnaired", Description = "Optional filter by items that are virtual unaired episodes or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool? IsVirtualUnaired { get; set; }
[ApiMember(Name = "MinCommunityRating", Description = "Optional filter by minimum community rating.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
public double? MinCommunityRating { get; set; }
[ApiMember(Name = "MinCriticRating", Description = "Optional filter by minimum critic rating.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
public double? MinCriticRating { get; set; }
}
/// <summary>
@ -564,6 +570,20 @@ namespace MediaBrowser.Api.UserLibrary
/// <returns>IEnumerable{BaseItem}.</returns>
private IEnumerable<BaseItem> ApplyAdditionalFilters(GetItems request, IEnumerable<BaseItem> items, User user)
{
if (request.MinCommunityRating.HasValue)
{
var val = request.MinCommunityRating.Value;
items = items.Where(i => i.CommunityRating.HasValue && i.CommunityRating >= val);
}
if (request.MinCriticRating.HasValue)
{
var val = request.MinCriticRating.Value;
items = items.Where(i => i.CriticRating.HasValue && i.CriticRating >= val);
}
// Artists
if (!string.IsNullOrEmpty(request.Artists))
{

View File

@ -261,7 +261,10 @@ namespace MediaBrowser.Model.Querying
/// </summary>
/// <value>The exclude location types.</value>
public LocationType[] ExcludeLocationTypes { get; set; }
public double? MinCommunityRating { get; set; }
public double? MinCriticRating { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ItemQuery" /> class.
/// </summary>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.235</version>
<version>3.0.237</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.235" />
<dependency id="MediaBrowser.Common" version="3.0.237" />
<dependency id="NLog" version="2.1.0" />
<dependency id="ServiceStack.Text" version="3.9.58" />
<dependency id="SimpleInjector" version="2.3.6" />

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.235</version>
<version>3.0.237</version>
<title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.235</version>
<version>3.0.237</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.235" />
<dependency id="MediaBrowser.Common" version="3.0.237" />
</dependencies>
</metadata>
<files>