|
|
@ -136,11 +136,26 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
|
|
|
channel.Name = GetChannelName(extInf, attributes);
|
|
|
|
channel.Name = GetChannelName(extInf, attributes);
|
|
|
|
channel.Number = GetChannelNumber(extInf, attributes, mediaUrl);
|
|
|
|
channel.Number = GetChannelNumber(extInf, attributes, mediaUrl);
|
|
|
|
|
|
|
|
|
|
|
|
var channelId = GetTunerChannelId(attributes);
|
|
|
|
string tvgId;
|
|
|
|
|
|
|
|
attributes.TryGetValue("tvg-id", out tvgId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string channelId;
|
|
|
|
|
|
|
|
attributes.TryGetValue("channel-id", out channelId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
channel.TunerChannelId = string.IsNullOrWhiteSpace(tvgId) ? channelId : tvgId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var channelIdValues = new List<string>();
|
|
|
|
if (!string.IsNullOrWhiteSpace(channelId))
|
|
|
|
if (!string.IsNullOrWhiteSpace(channelId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
channel.Id = channelId;
|
|
|
|
channelIdValues.Add(channelId);
|
|
|
|
channel.TunerChannelId = channelId;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(tvgId))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
channelIdValues.Add(tvgId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (channelIdValues.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
channel.Id = string.Join("_", channelIdValues.ToArray());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return channel;
|
|
|
|
return channel;
|
|
|
@ -296,24 +311,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
|
|
|
return name;
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string GetTunerChannelId(Dictionary<string, string> attributes)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var values = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string result;
|
|
|
|
|
|
|
|
if (attributes.TryGetValue("tvg-id", out result))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
values.Add(result);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attributes.TryGetValue("channel-id", out result))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
values.Add(result);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return values.Count == 0 ? null : string.Join("-", values.ToArray());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Dictionary<string, string> ParseExtInf(string line, out string remaining)
|
|
|
|
private Dictionary<string, string> ParseExtInf(string line, out string remaining)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
|
|
var dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
|
|