diff options
| author | hatharry <hatharry@hotmail.com> | 2016-10-11 17:10:00 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-11 17:10:00 +1300 |
| commit | 9b0ac4bde5beb74703a258d582f477c6411ec6ec (patch) | |
| tree | a59864414d58bd01c86085a36355fc553dd43736 /MediaBrowser.Api/ItemUpdateService.cs | |
| parent | 71386f0ceb15ce0bac2e588f90781a4bd274fe68 (diff) | |
| parent | cb26cb94579b772fa7825c6769dc7ace38217168 (diff) | |
Merge pull request #28 from MediaBrowser/dev
Dev
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(); - } - } } } |
