handle null channel number

This commit is contained in:
Luke Pulverenti 2017-01-31 16:25:54 -05:00
parent fcdd8cf899
commit bdf4cc0afa

View File

@ -847,12 +847,16 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
var channelMappings = GetChannelMappings(provider.Item2);
var channelNumber = channel.Number;
if (!string.IsNullOrWhiteSpace(channelNumber))
{
string mappedChannelNumber;
if (channelMappings.TryGetValue(channelNumber, out mappedChannelNumber))
{
_logger.Debug("Found mapped channel on provider {0}. Tuner channel number: {1}, Mapped channel number: {2}", provider.Item1.Name, channelNumber, mappedChannelNumber);
channelNumber = mappedChannelNumber;
}
}
var programs = await provider.Item1.GetProgramsAsync(provider.Item2, channelNumber, channel.Name, startDateUtc, endDateUtc, cancellationToken)
.ConfigureAwait(false);