diff options
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ArtistsService.cs')
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ArtistsService.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs index c5f7f492a..ad1007a31 100644 --- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs +++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs @@ -20,6 +20,11 @@ namespace MediaBrowser.Api.UserLibrary [Api(Description = "Gets all artists from a given item, folder, or the entire library")] public class GetArtists : GetItemsByName { + /// <summary> + /// Filter by artists that are on tour, or not + /// </summary> + /// <value><c>null</c> if [is on tour] contains no value, <c>true</c> if [is on tour]; otherwise, <c>false</c>.</value> + public bool? IsOnTour { get; set; } } /// <summary> @@ -149,6 +154,26 @@ namespace MediaBrowser.Api.UserLibrary } /// <summary> + /// Filters the items. + /// </summary> + /// <param name="request">The request.</param> + /// <param name="items">The items.</param> + /// <returns>IEnumerable{BaseItem}.</returns> + protected override IEnumerable<BaseItem> FilterItems(GetItemsByName request, IEnumerable<BaseItem> items) + { + items = base.FilterItems(request, items); + + var getArtists = (GetArtists) request; + + if (getArtists.IsOnTour.HasValue) + { + items = items.OfType<Artist>().Where(i => i.IsOnTour == getArtists.IsOnTour.Value); + } + + return items; + } + + /// <summary> /// Gets all items. /// </summary> /// <param name="request">The request.</param> |
