diff options
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; |
