From 0727475abfff42e32626d2def071a189168e7da1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 23 Jun 2014 12:05:19 -0400 Subject: update translations --- MediaBrowser.Api/UserLibrary/ArtistsService.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Api/UserLibrary/ArtistsService.cs') diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs index 3af6da4b1..20b0f5fb1 100644 --- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs +++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs @@ -20,7 +20,7 @@ namespace MediaBrowser.Api.UserLibrary { } - [Route("/AlbumArtists", "GET", Summary = "Gets all album artists from a given item, folder, or the entire library")] + [Route("/Artists/AlbumArtists", "GET", Summary = "Gets all album artists from a given item, folder, or the entire library")] public class GetAlbumArtists : GetItemsByName { } @@ -128,7 +128,24 @@ namespace MediaBrowser.Api.UserLibrary { if (request is GetAlbumArtists) { - return items.OfType(); + return items + .OfType() + .Where(i => !(i is MusicAlbum)) + .SelectMany(i => i.AlbumArtists) + .Distinct(StringComparer.OrdinalIgnoreCase) + .Select(name => + { + try + { + return LibraryManager.GetArtist(name); + } + catch (Exception ex) + { + Logger.ErrorException("Error getting artist {0}", ex, name); + return null; + } + + }).Where(i => i != null); } return items -- cgit v1.2.3