add a new endpoint param IsFavorite and use it for reports

This commit is contained in:
Shaun 2016-01-12 13:22:52 +11:00
parent cb751893a8
commit 9eaf22e54e
4 changed files with 10 additions and 8 deletions

View File

@ -215,6 +215,7 @@ namespace MediaBrowser.Api.Reports
Filter = i => ApplyAdditionalFilters(request, i, user, _libraryManager), Filter = i => ApplyAdditionalFilters(request, i, user, _libraryManager),
IsFavorite = request.IsFavorite,
Limit = request.Limit, Limit = request.Limit,
StartIndex = request.StartIndex, StartIndex = request.StartIndex,
IsMissing = request.IsMissing, IsMissing = request.IsMissing,
@ -275,9 +276,6 @@ namespace MediaBrowser.Api.Reports
case ItemFilter.IsFavorite: case ItemFilter.IsFavorite:
query.IsFavorite = true; query.IsFavorite = true;
break; break;
case ItemFilter.IsNotFavorite:
query.IsFavorite = false;
break;
case ItemFilter.IsFavoriteOrLikes: case ItemFilter.IsFavoriteOrLikes:
query.IsFavoriteOrLiked = true; query.IsFavoriteOrLiked = true;
break; break;

View File

@ -168,6 +168,13 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "Filters", Description = "Optional. Specify additional filters to apply. This allows multiple, comma delimeted. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] [ApiMember(Name = "Filters", Description = "Optional. Specify additional filters to apply. This allows multiple, comma delimeted. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
public string Filters { get; set; } public string Filters { get; set; }
/// <summary>
/// Gets or sets the Isfavorite option
/// </summary>
/// <value>IsFavorite</value>
[ApiMember(Name = "IsFavorite", Description = "Optional filter by items that are marked as favorite, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool? IsFavorite { get; set; }
/// <summary> /// <summary>
/// Gets or sets the media types. /// Gets or sets the media types.
/// </summary> /// </summary>

View File

@ -181,6 +181,7 @@ namespace MediaBrowser.Api.UserLibrary
Filter = i => ApplyAdditionalFilters(request, i, user, _libraryManager), Filter = i => ApplyAdditionalFilters(request, i, user, _libraryManager),
IsFavorite = request.IsFavorite,
Limit = request.Limit, Limit = request.Limit,
StartIndex = request.StartIndex, StartIndex = request.StartIndex,
IsMissing = request.IsMissing, IsMissing = request.IsMissing,

View File

@ -45,10 +45,6 @@ namespace MediaBrowser.Model.Querying
/// <summary> /// <summary>
/// The is favorite or likes /// The is favorite or likes
/// </summary> /// </summary>
IsFavoriteOrLikes = 10, IsFavoriteOrLikes = 10
/// <summary>
/// The item is not a favorite
/// </summary>
IsNotFavorite = 11
} }
} }