aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/UserLibrary/ArtistsService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-06-23 12:05:19 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-06-23 12:05:19 -0400
commit0727475abfff42e32626d2def071a189168e7da1 (patch)
treee2a486f33beb0bd49b293234f1b7b2c2c0223415 /MediaBrowser.Api/UserLibrary/ArtistsService.cs
parenteba1845f2a16dfbabdd009b0dc771183c9ffba76 (diff)
update translations
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ArtistsService.cs')
-rw-r--r--MediaBrowser.Api/UserLibrary/ArtistsService.cs21
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