diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-12 10:36:08 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-12 10:36:08 -0500 |
| commit | 9758adb8a57e3b43013d9feabdf413af6c964a0f (patch) | |
| tree | 0d067e5c8b5b15a1f0de3c03e147ea4a627a1968 /MediaBrowser.Server.Implementations/Dto/DtoService.cs | |
| parent | 8349b1f83ac77dc214085e4df70a1a5c5bef3909 (diff) | |
add soundtracks to theme media result
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto/DtoService.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Dto/DtoService.cs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index d327796f9..31b0c1a6a 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -102,9 +102,14 @@ namespace MediaBrowser.Server.Implementations.Dto if (fields.Contains(ItemFields.SoundtrackIds)) { - dto.SoundtrackIds = item.SoundtrackIds - .Select(i => i.ToString("N")) - .ToArray(); + var hasSoundtracks = item as IHasSoundtracks; + + if (hasSoundtracks != null) + { + dto.SoundtrackIds = hasSoundtracks.SoundtrackIds + .Select(i => i.ToString("N")) + .ToArray(); + } } var itemByName = item as IItemByName; @@ -131,12 +136,9 @@ namespace MediaBrowser.Server.Implementations.Dto //counts = item.ItemCounts; return; } - else + if (!item.UserItemCounts.TryGetValue(user.Id, out counts)) { - if (!item.UserItemCounts.TryGetValue(user.Id, out counts)) - { - counts = new ItemByNameCounts(); - } + counts = new ItemByNameCounts(); } dto.ChildCount = counts.TotalCount; @@ -967,6 +969,10 @@ namespace MediaBrowser.Server.Implementations.Dto if (album != null) { dto.Artists = album.Artists; + + dto.SoundtrackIds = album.SoundtrackIds + .Select(i => i.ToString("N")) + .ToArray(); } var hasAlbumArtist = item as IHasAlbumArtist; |
