mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 03:48:06 +02:00
Merge pull request #863 from fruhnow/tvg-chno
Adding support for "tvg-chno"-Tag in M3U Channel Lists
This commit is contained in:
commit
cac3a3e945
1 changed files with 40 additions and 36 deletions
|
@ -157,7 +157,38 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||||
var nameInExtInf = nameParts.Length > 1 ? nameParts.Last().Trim() : null;
|
var nameInExtInf = nameParts.Length > 1 ? nameParts.Last().Trim() : null;
|
||||||
|
|
||||||
string numberString = null;
|
string numberString = null;
|
||||||
|
string attributeValue;
|
||||||
|
double doubleValue;
|
||||||
|
|
||||||
|
if (attributes.TryGetValue("tvg-chno", out attributeValue))
|
||||||
|
{
|
||||||
|
if (double.TryParse(attributeValue, NumberStyles.Any, CultureInfo.InvariantCulture, out doubleValue))
|
||||||
|
{
|
||||||
|
numberString = attributeValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsValidChannelNumber(numberString))
|
||||||
|
{
|
||||||
|
if (attributes.TryGetValue("tvg-id", out attributeValue))
|
||||||
|
{
|
||||||
|
if (double.TryParse(attributeValue, NumberStyles.Any, CultureInfo.InvariantCulture, out doubleValue))
|
||||||
|
{
|
||||||
|
numberString = attributeValue;
|
||||||
|
}
|
||||||
|
else if (attributes.TryGetValue("channel-id", out attributeValue))
|
||||||
|
{
|
||||||
|
if (double.TryParse(attributeValue, NumberStyles.Any, CultureInfo.InvariantCulture, out doubleValue))
|
||||||
|
{
|
||||||
|
numberString = attributeValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrWhiteSpace(numberString))
|
||||||
|
{
|
||||||
|
// Using this as a fallback now as this leads to Problems with channels like "5 USA"
|
||||||
|
// where 5 isnt ment to be the channel number
|
||||||
// Check for channel number with the format from SatIp
|
// Check for channel number with the format from SatIp
|
||||||
// #EXTINF:0,84. VOX Schweiz
|
// #EXTINF:0,84. VOX Schweiz
|
||||||
// #EXTINF:0,84.0 - VOX Schweiz
|
// #EXTINF:0,84.0 - VOX Schweiz
|
||||||
|
@ -174,39 +205,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(numberString))
|
|
||||||
{
|
|
||||||
numberString = numberString.Trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsValidChannelNumber(numberString))
|
|
||||||
{
|
|
||||||
if (attributes.TryGetValue("tvg-id", out string value))
|
|
||||||
{
|
|
||||||
if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out var doubleValue))
|
|
||||||
{
|
|
||||||
numberString = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(numberString))
|
|
||||||
{
|
|
||||||
numberString = numberString.Trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IsValidChannelNumber(numberString))
|
|
||||||
{
|
|
||||||
if (attributes.TryGetValue("channel-id", out string value))
|
|
||||||
{
|
|
||||||
numberString = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(numberString))
|
|
||||||
{
|
|
||||||
numberString = numberString.Trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsValidChannelNumber(numberString))
|
if (!IsValidChannelNumber(numberString))
|
||||||
|
@ -214,7 +214,11 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||||
numberString = null;
|
numberString = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(numberString))
|
if (!string.IsNullOrWhiteSpace(numberString))
|
||||||
|
{
|
||||||
|
numberString = numberString.Trim();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(mediaUrl))
|
if (string.IsNullOrWhiteSpace(mediaUrl))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue