Skip to content

Commit

Permalink
IPTV m3u channel import with USA channel numbers
Browse files Browse the repository at this point in the history
Allow IPTV m3u channel importing from HDHomeRun tuners to insert
channels with decimals, such as "2.1" or "23.11"
The validation of HDHomeRun channel numbers is changed to allow
any non-empty string as channel number instead of only an integer number.

Refs #860
  • Loading branch information
kmdewaal committed Feb 12, 2024
1 parent 59e4f3c commit 62ad21b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,16 +536,15 @@ static bool parse_extinf(const QString &line,

// Parse extension, HDHomeRun style
// EG. #EXTINF:-1 channel-id="22" channel-number="22" tvg-name="Omroep Brabant",22 Omroep Brabant
// #EXTINF:-1 channel-id="2.1" channel-number="2.1" tvg-name="CBS2-HD",2.1 CBS2-HD
static const QRegularExpression chanNumName6
{ R"(^-?\d+\s+channel-id=\"([^\"]+)\"\s+channel-number=\"([^\"]+)\"\s+tvg-name=\"([^\"]+)\".*$)" };
match = chanNumName6.match(line);
if (match.hasMatch())
{
channum = match.captured(2).simplified();
name = match.captured(3).simplified();
bool ok = false;
int channel_number = channum.toInt (&ok);
if (ok && (channel_number > 0))
if (!channum.isEmpty() && !name.isEmpty())
{
return true;
}
Expand Down

0 comments on commit 62ad21b

Please sign in to comment.