update channel mapping

This commit is contained in:
Luke Pulverenti 2017-02-08 16:29:08 -05:00
parent 2fa03c19d4
commit 1e28de1098
2 changed files with 11 additions and 7 deletions

View file

@ -469,16 +469,20 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public ChannelInfo GetEpgChannelFromTunerChannel(List<NameValuePair> mappings, ChannelInfo tunerChannel, List<ChannelInfo> epgChannels)
{
if (!string.IsNullOrWhiteSpace(tunerChannel.TunerChannelId))
{
var tunerChannelId = GetMappedChannel(tunerChannel.TunerChannelId, mappings);
var tunerChannelId = string.IsNullOrWhiteSpace(tunerChannel.TunerChannelId)
? tunerChannel.Id
: tunerChannel.TunerChannelId;
if (string.IsNullOrWhiteSpace(tunerChannelId))
if (!string.IsNullOrWhiteSpace(tunerChannelId))
{
var mappedTunerChannelId = GetMappedChannel(tunerChannelId, mappings);
if (string.IsNullOrWhiteSpace(mappedTunerChannelId))
{
tunerChannelId = tunerChannel.TunerChannelId;
mappedTunerChannelId = tunerChannelId;
}
var channel = epgChannels.FirstOrDefault(i => string.Equals(tunerChannelId, i.Id, StringComparison.OrdinalIgnoreCase));
var channel = epgChannels.FirstOrDefault(i => string.Equals(mappedTunerChannelId, i.Id, StringComparison.OrdinalIgnoreCase));
if (channel != null)
{

View file

@ -791,7 +791,7 @@ namespace MediaBrowser.Api.LiveTv
ProviderChannels = providerChannels.Select(i => new NameIdPair
{
Name = i.Name,
Id = i.TunerChannelId
Id = string.IsNullOrWhiteSpace(i.TunerChannelId) ? i.Id : i.TunerChannelId
}).ToList(),