diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-08 01:57:38 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-08 01:57:38 -0400 |
| commit | 5cd3276775461d96d912d47fbae6857b887b98d0 (patch) | |
| tree | 3743825b4db8587aa1cec132cf0e4752a8f8d17a /MediaBrowser.Server.Implementations/Dto | |
| parent | 1591b16e003700d119732c2c7aa38d34583263dd (diff) | |
pass requested fields to data layer
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Dto/DtoService.cs | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 46ee29b63a..ae204c892a 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -907,9 +907,13 @@ namespace MediaBrowser.Server.Implementations.Dto dto.Keywords = item.Keywords; } - if (fields.Contains(ItemFields.ProductionLocations)) + if (fields.Contains(ItemFields.PlaceOfBirth)) { - SetProductionLocations(item, dto); + var person = item as Person; + if (person != null) + { + dto.PlaceOfBirth = person.PlaceOfBirth; + } } var hasAspectRatio = item as IHasAspectRatio; @@ -998,8 +1002,11 @@ namespace MediaBrowser.Server.Implementations.Dto } dto.Audio = item.Audio; - dto.PreferredMetadataCountryCode = item.PreferredMetadataCountryCode; - dto.PreferredMetadataLanguage = item.PreferredMetadataLanguage; + if (fields.Contains(ItemFields.Settings)) + { + dto.PreferredMetadataCountryCode = item.PreferredMetadataCountryCode; + dto.PreferredMetadataLanguage = item.PreferredMetadataLanguage; + } dto.CriticRating = item.CriticRating; @@ -1089,10 +1096,9 @@ namespace MediaBrowser.Server.Implementations.Dto if (fields.Contains(ItemFields.Taglines)) { - var hasTagline = item as IHasTaglines; - if (hasTagline != null) + if (!string.IsNullOrWhiteSpace(item.Tagline)) { - dto.Taglines = hasTagline.Taglines; + dto.Taglines = new List<string> { item.Tagline }; } if (dto.Taglines == null) @@ -1529,31 +1535,6 @@ namespace MediaBrowser.Server.Implementations.Dto return path; } - private void SetProductionLocations(BaseItem item, BaseItemDto dto) - { - var hasProductionLocations = item as IHasProductionLocations; - - if (hasProductionLocations != null) - { - dto.ProductionLocations = hasProductionLocations.ProductionLocations; - } - - var person = item as Person; - if (person != null) - { - dto.ProductionLocations = new List<string>(); - if (!string.IsNullOrEmpty(person.PlaceOfBirth)) - { - dto.ProductionLocations.Add(person.PlaceOfBirth); - } - } - - if (dto.ProductionLocations == null) - { - dto.ProductionLocations = new List<string>(); - } - } - /// <summary> /// Attaches the primary image aspect ratio. /// </summary> |
