From 62ad21bb8c0d4fe24e30c9d82b9bff95a30c45a7 Mon Sep 17 00:00:00 2001 From: Klaas de Waal Date: Mon, 12 Feb 2024 23:22:14 +0100 Subject: [PATCH] IPTV m3u channel import with USA channel numbers 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 --- mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp b/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp index 274a18fbc42..7794fb3e7bf 100644 --- a/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp +++ b/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp @@ -536,6 +536,7 @@ 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); @@ -543,9 +544,7 @@ static bool parse_extinf(const QString &line, { 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; }