add a new endpoint param IsFavorite and use it for reports

pull/1154/head
Shaun 9 years ago
parent cb751893a8
commit 9eaf22e54e

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

@ -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)]
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>
/// Gets or sets the media types.
/// </summary>

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

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

Loading…
Cancel
Save