diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-23 12:05:19 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-23 12:05:19 -0400 |
| commit | 0727475abfff42e32626d2def071a189168e7da1 (patch) | |
| tree | e2a486f33beb0bd49b293234f1b7b2c2c0223415 /MediaBrowser.Api/UserLibrary/ArtistsService.cs | |
| parent | eba1845f2a16dfbabdd009b0dc771183c9ffba76 (diff) | |
update translations
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ArtistsService.cs')
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ArtistsService.cs | 21 |
1 files changed, 19 insertions, 2 deletions
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<MusicArtist>(); + return items + .OfType<IHasAlbumArtist>() + .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 |
