Ticket #363: dbox2.patch
File dbox2.patch, 2.2 KB (added by , 19 years ago) |
---|
-
dbox2epg.cpp
old new 67 67 // Wait before processing 68 68 usleep(waitTime); 69 69 70 RequestEPG(m_requestedChannel); 71 m_pendingRequest = false; 70 // Only grab the EPG for this channel if useonairguide is set to 1 71 // Qstring::compare returns zero if both strings are equal 72 73 if (!QString::compare( CheckUseOnAirGuide(), "1") ) 74 { 75 RequestEPG(m_requestedChannel); 76 m_pendingRequest = false; 77 } 78 79 else 80 { 81 // do nothing 82 printf (QString("Skipping EPG grab for channel %1 \n").arg(m_requestedChannel)); 83 EPGFinished(); 84 } 85 72 86 } 73 87 #ifdef DEBUG_DBOX2EPG 74 88 VERBOSE(VB_IMPORTANT, QString("DBOXEPG#%1: Exiting Thread....").arg(m_cardid)); … … 244 258 } 245 259 return ""; 246 260 } 261 QString DBox2EPG::CheckUseOnAirGuide() 262 { 263 MSqlQuery query(MSqlQuery::InitCon()); 264 query.prepare("SELECT useonairguide " 265 "FROM channel " 266 "WHERE " 267 "channel.channum = :CHANNUM"); 268 query.bindValue(":CHANNUM", m_requestedChannel); 247 269 270 if (query.exec() && query.isActive() && query.size() > 0) 271 { 272 query.next(); 273 return query.value(0).toString(); 274 } 275 return ""; 276 } -
dbox2epg.h
old new 7 7 #ifndef DBOX2EPG_H_ 8 8 #define DBOX2EPG_H_ 9 9 10 #include <map> 11 using namespace std; 12 13 #include <qhttp.h> 10 #include "qhttp.h" 14 11 #include <qobject.h> 15 12 #include <qthread.h> 16 17 13 #include "mythcontext.h" 18 14 #include "tv_rec.h" 19 15 #include "dbox2channel.h" … … 30 26 void RequestEPG(const QString& channelNumber); 31 27 void ScheduleRequestEPG(const QString& channelNumber); 32 28 void Shutdown(); 33 34 29 public slots: 35 30 void httpRequestFinished(int requestID, bool error); 36 31 … … 42 37 void UpdateDataBase(QString* chanID, QDateTime* startTime, QDateTime* endTime, QString* title, QString *description, QString *category); 43 38 QString DBox2EPG::ParseNextLine(QByteArray buffer, int* index, int size); 44 39 QString GetChannelID(const QString& channelnumber) ; 40 QString CheckUseOnAirGuide() ; 45 41 void run(); 46 42 47 43 QHttp* http;