diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-05-17 15:18:50 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-05-17 15:18:50 -0400 |
| commit | da29fc8c687dd80f2183f49c3b3caf125e9b5466 (patch) | |
| tree | f5b7af0a123a490c775fe09ffefbbf4e1478c430 /MediaBrowser.Server.Implementations | |
| parent | 6186c4ff706fa909bd1f3d4a7c7b9d96cf91e54c (diff) | |
update channel display
Diffstat (limited to 'MediaBrowser.Server.Implementations')
| -rw-r--r-- | MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 9251ccb9e..dc347c1dc 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -527,6 +527,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv private async Task<LiveTvChannel> GetChannel(ChannelInfo channelInfo, string serviceName, Guid parentFolderId, CancellationToken cancellationToken) { var isNew = false; + var forceUpdate = false; var id = _tvDtoService.GetInternalChannelId(serviceName, channelInfo.Id); @@ -576,10 +577,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv if (!string.IsNullOrWhiteSpace(channelInfo.ImagePath)) { item.SetImagePath(ImageType.Primary, channelInfo.ImagePath); + forceUpdate = true; } else if (!string.IsNullOrWhiteSpace(channelInfo.ImageUrl)) { item.SetImagePath(ImageType.Primary, channelInfo.ImageUrl); + forceUpdate = true; } } @@ -588,9 +591,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv item.Name = channelInfo.Name; } + if (isNew) + { + await _libraryManager.CreateItem(item, cancellationToken).ConfigureAwait(false); + } + else if (forceUpdate) + { + await _libraryManager.UpdateItem(item, ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false); + } + await item.RefreshMetadata(new MetadataRefreshOptions(_fileSystem) { - ForceSave = isNew + ForceSave = isNew || forceUpdate }, cancellationToken); |
