From d7bbfff23f7cec1f06c5ea9e99c7868e552256ec Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 13 Oct 2017 01:44:40 -0400 Subject: [PATCH] preserve channel info from provider --- .../LiveTv/LiveTvManager.cs | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs index ec2704aa08..718620ab57 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs @@ -527,18 +527,18 @@ namespace Emby.Server.Implementations.LiveTv item.ChannelType = channelInfo.ChannelType; item.ServiceName = serviceName; + + if (!string.Equals(channelInfo.Number, item.Number, StringComparison.Ordinal)) + { + forceUpdate = true; + } item.Number = channelInfo.Number; - //if (!string.Equals(item.ProviderImageUrl, channelInfo.ImageUrl, StringComparison.OrdinalIgnoreCase)) - //{ - // isNew = true; - // replaceImages.Add(ImageType.Primary); - //} - //if (!string.Equals(item.ProviderImagePath, channelInfo.ImagePath, StringComparison.OrdinalIgnoreCase)) - //{ - // isNew = true; - // replaceImages.Add(ImageType.Primary); - //} + if (!string.Equals(channelInfo.Name, item.Name, StringComparison.Ordinal)) + { + forceUpdate = true; + } + item.Name = channelInfo.Name; if (!item.HasImage(ImageType.Primary)) { @@ -554,11 +554,6 @@ namespace Emby.Server.Implementations.LiveTv } } - if (string.IsNullOrEmpty(item.Name)) - { - item.Name = channelInfo.Name; - } - if (isNew) { _libraryManager.CreateItem(item, cancellationToken); @@ -2923,7 +2918,7 @@ namespace Emby.Server.Implementations.LiveTv public Folder GetInternalLiveTvFolder(CancellationToken cancellationToken) { - var name = _localization.GetLocalizedString("ViewTypeLiveTV"); + var name = _localization.GetLocalizedString("HeaderLiveTV"); return _libraryManager.GetNamedView(name, CollectionType.LiveTv, name, cancellationToken); }