aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Dto/DtoService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-13 11:54:20 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-13 11:54:20 -0400
commita92723fde3fc44410c782ee93d36c749ae8d6f82 (patch)
tree19a4730ca536d8a3bfe3b2404adef526b8ea4ae6 /MediaBrowser.Server.Implementations/Dto/DtoService.cs
parent4309455c37c25eb7b4ab89920358d7cced1ebddc (diff)
add AlbumArtists to item dto's
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto/DtoService.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Dto/DtoService.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
index f9b7470b2..8086033eb 100644
--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs
+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
@@ -1175,6 +1175,28 @@ namespace MediaBrowser.Server.Implementations.Dto
if (hasAlbumArtist != null)
{
dto.AlbumArtist = hasAlbumArtist.AlbumArtists.FirstOrDefault();
+
+ dto.AlbumArtists = hasAlbumArtist
+ .AlbumArtists
+ .Select(i =>
+ {
+ try
+ {
+ var artist = _libraryManager.GetArtist(i);
+ return new NameIdPair
+ {
+ Name = artist.Name,
+ Id = artist.Id.ToString("N")
+ };
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Error getting album artist", ex);
+ return null;
+ }
+ })
+ .Where(i => i != null)
+ .ToList();
}
// Add video info