diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-02 11:46:25 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-02 11:46:25 -0500 |
| commit | cd279d98e0574c396c0a35984e46658151e54fc0 (patch) | |
| tree | 13f09923cd1c07ef22d959fe0a21842d0ef844eb /MediaBrowser.Server.Implementations/Dto/DtoService.cs | |
| parent | 317f41107091a4334b9133a21e570d627a2d808a (diff) | |
added IHasTrailers
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto/DtoService.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Dto/DtoService.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index b43449858..90ca64058 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -808,11 +808,17 @@ namespace MediaBrowser.Server.Implementations.Dto } } - var localTrailerCount = item.LocalTrailerIds.Count; + var hasTrailers = item as IHasTrailers; + if (hasTrailers != null) + { + dto.LocalTrailerCount = hasTrailers.LocalTrailerIds.Count; + } - if (localTrailerCount > 0) + if (fields.Contains(ItemFields.RemoteTrailers)) { - dto.LocalTrailerCount = localTrailerCount; + dto.RemoteTrailers = hasTrailers != null ? + hasTrailers.RemoteTrailers : + new List<MediaUrl>(); } dto.Name = item.Name; @@ -925,11 +931,6 @@ namespace MediaBrowser.Server.Implementations.Dto dto.Taglines = item.Taglines; } - if (fields.Contains(ItemFields.RemoteTrailers)) - { - dto.RemoteTrailers = item.RemoteTrailers; - } - dto.Type = item.GetClientTypeName(); dto.CommunityRating = item.CommunityRating; dto.VoteCount = item.VoteCount; |
