From eba1845f2a16dfbabdd009b0dc771183c9ffba76 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 22 Jun 2014 12:49:39 -0400 Subject: [PATCH] add album artists endpoint --- .../UserLibrary/ArtistsService.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs index 8b1c5ba888..3af6da4b1d 100644 --- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs +++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs @@ -20,6 +20,11 @@ namespace MediaBrowser.Api.UserLibrary { } + [Route("/AlbumArtists", "GET", Summary = "Gets all album artists from a given item, folder, or the entire library")] + public class GetAlbumArtists : GetItemsByName + { + } + [Route("/Artists/{Name}", "GET", Summary = "Gets an artist, by name")] public class GetArtist : IReturn { @@ -101,6 +106,18 @@ namespace MediaBrowser.Api.UserLibrary return ToOptimizedResult(result); } + /// + /// Gets the specified request. + /// + /// The request. + /// System.Object. + public object Get(GetAlbumArtists request) + { + var result = GetResult(request); + + return ToOptimizedResult(result); + } + /// /// Gets all items. /// @@ -109,6 +126,11 @@ namespace MediaBrowser.Api.UserLibrary /// IEnumerable{Tuple{System.StringFunc{System.Int32}}}. protected override IEnumerable GetAllItems(GetItemsByName request, IEnumerable items) { + if (request is GetAlbumArtists) + { + return items.OfType(); + } + return items .OfType() .Where(i => !(i is MusicAlbum))