diff options
| author | Eric Reed <ebr@mediabrowser3.com> | 2013-04-24 10:44:22 -0400 |
|---|---|---|
| committer | Eric Reed <ebr@mediabrowser3.com> | 2013-04-24 10:44:22 -0400 |
| commit | da6bcc18307e53748480cd25695ef7ffa84f6a1b (patch) | |
| tree | 1df09d68210a887e9386edad1c80760268179829 /MediaBrowser.Api/UserLibrary/ArtistsService.cs | |
| parent | 7f0b662b513be78e68a3ee0087c98cb170e7b0ad (diff) | |
| parent | 0d15e1d631a220f2d1288ad9632e3cfaa8ede479 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
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> |
