From 1c8e30b140dd7b314fc1d6134a486893b29d6725 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Sun, 16 Jun 2013 14:48:54 +0100 Subject: [PATCH] IPTVChannelFetcher: remove the need for the depreciated HttpComms This uses the MythDownloadManager to download the playlist. I've no way to test this but should just be a drop in replacement. Should also fix the IPTVChannelFetcher on Qt5. --- .../channelscan/iptvchannelfetcher.cpp | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp b/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp index 9e6281c7d38..d1ec1e908e9 100644 --- a/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp +++ b/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp @@ -15,10 +15,7 @@ #include "iptvchannelfetcher.h" #include "scanmonitor.h" #include "mythlogging.h" - -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#include "httpcomms.h" -#endif +#include "mythdownloadmanager.h" #define LOC QString("IPTVChanFetch: ") @@ -230,25 +227,18 @@ QString IPTVChannelFetcher::DownloadPlaylist(const QString &url, return ret; } - // Use Myth HttpComms for http URLs - QString redirected_url = url; - -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QString tmp = HttpComms::getHttp( - redirected_url, - 10000 /* ms */, 3 /* retries */, - 3 /* redirects */, true /* allow gzip */, - NULL /* login */, inQtThread); -#else -#warning IPTVChannelFetcher::DownloadPlaylist not yet ported to Qt5. - QString tmp(""); -#endif - - if (redirected_url != url) + // Use MythDownloadManager for http URLs + QByteArray data; + QString tmp; + + if (!GetMythDownloadManager()->download(url, &data)) { - LOG(VB_CHANNEL, LOG_INFO, QString("Channel URL redirected to %1") - .arg(redirected_url)); + LOG(VB_GENERAL, LOG_INFO, + QString("IPTVChannelFetcher::DownloadPlaylist failed to " + "download from %1").arg(url)); } + else + tmp = QString(data); return QString::fromUtf8(tmp.toLatin1().constData()); }