diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-22 12:49:39 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-22 12:49:39 -0400 |
| commit | eba1845f2a16dfbabdd009b0dc771183c9ffba76 (patch) | |
| tree | 698317230ecdb179927a214e76c66d0e3f6b009e /MediaBrowser.Api/UserLibrary/ArtistsService.cs | |
| parent | 3b30a2aee09bb045e466486fc0fff8a11cc6de74 (diff) | |
add album artists endpoint
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ArtistsService.cs')
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ArtistsService.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs index 8b1c5ba88..3af6da4b1 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<BaseItemDto> { @@ -102,6 +107,18 @@ namespace MediaBrowser.Api.UserLibrary } /// <summary> + /// Gets the specified request. + /// </summary> + /// <param name="request">The request.</param> + /// <returns>System.Object.</returns> + public object Get(GetAlbumArtists request) + { + var result = GetResult(request); + + return ToOptimizedResult(result); + } + + /// <summary> /// Gets all items. /// </summary> /// <param name="request">The request.</param> @@ -109,6 +126,11 @@ namespace MediaBrowser.Api.UserLibrary /// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns> protected override IEnumerable<MusicArtist> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items) { + if (request is GetAlbumArtists) + { + return items.OfType<MusicArtist>(); + } + return items .OfType<IHasArtist>() .Where(i => !(i is MusicAlbum)) |
