diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto/DtoService.cs')
| -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 46ee29b63..ae204c892 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> |
