diff options
Diffstat (limited to 'MediaBrowser.Api/ItemUpdateService.cs')
| -rw-r--r-- | MediaBrowser.Api/ItemUpdateService.cs | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 2778cfe29..687a21a46 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -70,12 +70,13 @@ namespace MediaBrowser.Api Cultures = _localizationManager.GetCultures().ToList() }; - if (!item.IsVirtualItem && !(item is ICollectionFolder) && !(item is UserView) && !(item is AggregateFolder) && !(item is LiveTvChannel) && !(item is IItemByName)) + if (!item.IsVirtualItem && !(item is ICollectionFolder) && !(item is UserView) && !(item is AggregateFolder) && !(item is LiveTvChannel) && !(item is IItemByName) && + item.SourceType == SourceType.Library) { var inheritedContentType = _libraryManager.GetInheritedContentType(item); var configuredContentType = _libraryManager.GetConfiguredContentType(item); - if (string.IsNullOrWhiteSpace(inheritedContentType) || string.Equals(inheritedContentType, CollectionType.TvShows, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(configuredContentType)) + if (string.IsNullOrWhiteSpace(inheritedContentType) || !string.IsNullOrWhiteSpace(configuredContentType)) { info.ContentTypeOptions = GetContentTypeOptions(true); info.ContentType = configuredContentType; @@ -242,11 +243,7 @@ namespace MediaBrowser.Api hasBudget.Revenue = request.Revenue; } - var hasOriginalTitle = item as IHasOriginalTitle; - if (hasOriginalTitle != null) - { - hasOriginalTitle.OriginalTitle = hasOriginalTitle.OriginalTitle; - } + item.OriginalTitle = string.IsNullOrWhiteSpace(request.OriginalTitle) ? null : request.OriginalTitle; var hasCriticRating = item as IHasCriticRating; if (hasCriticRating != null) @@ -277,10 +274,9 @@ namespace MediaBrowser.Api item.Tags = request.Tags; - var hasTaglines = item as IHasTaglines; - if (hasTaglines != null) + if (request.Taglines != null) { - hasTaglines.Taglines = request.Taglines; + item.Tagline = request.Taglines.FirstOrDefault(); } var hasShortOverview = item as IHasShortOverview; @@ -307,8 +303,6 @@ namespace MediaBrowser.Api item.OfficialRating = string.IsNullOrWhiteSpace(request.OfficialRating) ? null : request.OfficialRating; item.CustomRating = request.CustomRating; - SetProductionLocations(item, request); - item.PreferredMetadataCountryCode = request.PreferredMetadataCountryCode; item.PreferredMetadataLanguage = request.PreferredMetadataLanguage; @@ -416,23 +410,5 @@ namespace MediaBrowser.Api series.AirTime = request.AirTime; } } - - private void SetProductionLocations(BaseItem item, BaseItemDto request) - { - var hasProductionLocations = item as IHasProductionLocations; - - if (hasProductionLocations != null) - { - hasProductionLocations.ProductionLocations = request.ProductionLocations; - } - - var person = item as Person; - if (person != null) - { - person.PlaceOfBirth = request.ProductionLocations == null - ? null - : request.ProductionLocations.FirstOrDefault(); - } - } } } |
