MythTV  master
filldata.cpp
Go to the documentation of this file.
1 // POSIX headers
2 #include <unistd.h>
3 
4 // Std C headers
5 #include <cstdlib>
6 #include <ctime>
7 
8 // C++ headers
9 #include <fstream>
10 using namespace std;
11 
12 // Qt headers
13 #include <QTextStream>
14 #include <QDateTime>
15 #include <QFile>
16 #include <QList>
17 #include <QMap>
18 #include <QDir>
19 
20 // MythTV headers
21 #include "mythmiscutil.h"
22 #include "exitcodes.h"
23 #include "mythlogging.h"
24 #include "mythdbcon.h"
25 #include "compat.h"
26 #include "mythdate.h"
27 #include "mythdirs.h"
28 #include "mythdb.h"
29 #include "mythsystemlegacy.h"
30 #include "videosource.h" // for is_grabber..
31 #include "mythcorecontext.h"
32 
33 // filldata headers
34 #include "filldata.h"
35 
36 #define LOC QString("FillData: ")
37 #define LOC_WARN QString("FillData, Warning: ")
38 #define LOC_ERR QString("FillData, Error: ")
39 
40 bool updateLastRunEnd(void)
41 {
42  QDateTime qdtNow = MythDate::current();
43  return gCoreContext->SaveSettingOnHost("mythfilldatabaseLastRunEnd",
44  qdtNow.toString(Qt::ISODate),
45  nullptr);
46 }
47 
49 {
51  QDateTime qdtNow = MythDate::current();
52  return gCoreContext->SaveSettingOnHost("mythfilldatabaseLastRunStart",
53  qdtNow.toString(Qt::ISODate),
54  nullptr);
55 }
56 
57 bool updateLastRunStatus(QString &status)
58 {
59  return gCoreContext->SaveSettingOnHost("mythfilldatabaseLastRunStatus",
60  status,
61  nullptr);
62 }
63 
65 {
66  QDateTime nextSuggestedTime = MythDate::current().addDays(1);
67  return gCoreContext->SaveSettingOnHost("MythFillSuggestedRunTime",
68  nextSuggestedTime.toString(Qt::ISODate),
69  nullptr);
70 }
71 
72 void FillData::SetRefresh(int day, bool set)
73 {
74  if (kRefreshClear == day)
75  {
76  m_refreshAll = set;
77  m_refreshDay.clear();
78  }
79  else if (kRefreshAll == day)
80  {
81  m_refreshAll = set;
82  }
83  else
84  {
85  m_refreshDay[(uint)day] = set;
86  }
87 }
88 
89 // XMLTV stuff
90 bool FillData::GrabDataFromFile(int id, QString &filename)
91 {
92  ChannelInfoList chanlist;
93  QMap<QString, QList<ProgInfo> > proglist;
94 
95  if (!m_xmltvParser.parseFile(filename, &chanlist, &proglist))
96  return false;
97 
98  m_chanData.handleChannels(id, &chanlist);
99  if (proglist.count() == 0)
100  {
101  LOG(VB_GENERAL, LOG_INFO, "No programs found in data.");
102  m_endOfData = true;
103  }
104  else
105  {
106  ProgramData::HandlePrograms(id, proglist);
107  }
108  return true;
109 }
110 
111 bool FillData::GrabData(const Source& source, int offset)
112 {
113  QString xmltv_grabber = source.xmltvgrabber;
114 
115  const QString templatename = "/tmp/mythXXXXXX";
116  const QString tempfilename = createTempFile(templatename);
117  if (templatename == tempfilename)
118  {
119  m_fatalErrors.push_back("Failed to create temporary file.");
120  return false;
121  }
122 
123  QString filename = QString(tempfilename);
124 
125  QString configfile;
126 
127  MSqlQuery query1(MSqlQuery::InitCon());
128  query1.prepare("SELECT configpath FROM videosource"
129  " WHERE sourceid = :ID AND configpath IS NOT NULL");
130  query1.bindValue(":ID", source.id);
131  if (!query1.exec())
132  {
133  MythDB::DBError("FillData::grabData", query1);
134  return false;
135  }
136 
137  if (query1.next())
138  configfile = query1.value(0).toString();
139  else
140  configfile = QString("%1/%2.xmltv").arg(GetConfDir())
141  .arg(source.name);
142 
143  LOG(VB_GENERAL, LOG_INFO,
144  QString("XMLTV config file is: %1").arg(configfile));
145 
146  QString command = QString("nice %1 --config-file '%2' --output %3")
147  .arg(xmltv_grabber).arg(configfile).arg(filename);
148 
149 
150  if (source.xmltvgrabber_prefmethod != "allatonce" || m_noAllAtOnce)
151  {
152  // XMLTV Docs don't recommend grabbing one day at a
153  // time but the current MythTV code is heavily geared
154  // that way so until it is re-written behave as
155  // we always have done.
156  command += QString(" --days 1 --offset %1").arg(offset);
157  }
158 
159  if (!VERBOSE_LEVEL_CHECK(VB_XMLTV, LOG_ANY))
160  command += " --quiet";
161 
162  // Append additional arguments passed to mythfilldatabase
163  // using --graboptions
164  if (!m_grabOptions.isEmpty())
165  {
166  command += m_grabOptions;
167  LOG(VB_XMLTV, LOG_INFO,
168  QString("Using graboptions: %1").arg(m_grabOptions));
169  }
170 
171  QString status = QObject::tr("currently running.");
172 
174  updateLastRunStatus(status);
175 
176  LOG(VB_XMLTV, LOG_INFO, QString("Grabber Command: %1").arg(command));
177 
178  LOG(VB_XMLTV, LOG_INFO,
179  "----------------- Start of XMLTV output -----------------");
180 
181  uint systemcall_status = myth_system(command, kMSRunShell);
182  bool succeeded = (systemcall_status == GENERIC_EXIT_OK);
183 
184  LOG(VB_XMLTV, LOG_INFO,
185  "------------------ End of XMLTV output ------------------");
186 
188 
189  status = QObject::tr("Successful.");
190 
191  if (!succeeded)
192  {
193  if (systemcall_status == GENERIC_EXIT_KILLED)
194  {
195  m_interrupted = true;
196  status = QObject::tr("FAILED: XMLTV grabber ran but was interrupted.");
197  }
198  else
199  {
200  status = QObject::tr("FAILED: XMLTV grabber returned error code %1.")
201  .arg(systemcall_status);
202  LOG(VB_GENERAL, LOG_ERR, LOC +
203  QString("XMLTV grabber returned error code %1")
204  .arg(systemcall_status));
205  }
206  }
207 
208  updateLastRunStatus(status);
209 
210  succeeded &= GrabDataFromFile(source.id, filename);
211 
212  QFile thefile(filename);
213  thefile.remove();
214 
215  return succeeded;
216 }
217 
223 bool FillData::Run(SourceList &sourcelist)
224 {
225  SourceList::iterator it;
226 
227  QString status;
228  QString querystr;
230  QDateTime GuideDataBefore;
231  QDateTime GuideDataAfter;
232  int failures = 0;
233  int externally_handled = 0;
234  int total_sources = sourcelist.size();
235  int source_channels = 0;
236 
237  QString sidStr = QString("Updating source #%1 (%2) with grabber %3");
238 
239  m_needPostGrabProc = false;
240  int nonewdata = 0;
241 
242  for (it = sourcelist.begin(); it != sourcelist.end(); ++it)
243  {
244  if (!m_fatalErrors.empty())
245  break;
246 
247  QString xmltv_grabber = (*it).xmltvgrabber;
248 
249  if (xmltv_grabber == "datadirect" ||
250  xmltv_grabber == "schedulesdirect1")
251  {
252  LOG(VB_GENERAL, LOG_ERR,
253  QString("Source %1 is configured to use the DataDirect guide"
254  "service from Schedules Direct. That service is no "
255  "longer supported by MythTV. Update to use one of "
256  "the XMLTV grabbers that use the JSON-based guide "
257  "service from Schedules Direct.")
258  .arg((*it).id));
259  continue;
260  }
261 
262  query.prepare("SELECT MAX(endtime) "
263  "FROM program p "
264  "LEFT JOIN channel c ON p.chanid=c.chanid "
265  "WHERE c.deleted IS NULL AND c.sourceid= :SRCID "
266  " AND manualid = 0 AND c.xmltvid != '';");
267  query.bindValue(":SRCID", (*it).id);
268 
269  if (query.exec() && query.next())
270  {
271  if (!query.isNull(0))
272  GuideDataBefore =
273  MythDate::fromString(query.value(0).toString());
274  }
275 
276  m_channelUpdateRun = false;
277  m_endOfData = false;
278 
279  if (xmltv_grabber == "eitonly")
280  {
281  LOG(VB_GENERAL, LOG_INFO,
282  QString("Source %1 configured to use only the "
283  "broadcasted guide data. Skipping.") .arg((*it).id));
284 
285  externally_handled++;
288  continue;
289  }
290  if (xmltv_grabber.trimmed().isEmpty() ||
291  xmltv_grabber == "/bin/true" ||
292  xmltv_grabber == "none")
293  {
294  LOG(VB_GENERAL, LOG_INFO,
295  QString("Source %1 configured with no grabber. Nothing to do.")
296  .arg((*it).id));
297 
298  externally_handled++;
301  continue;
302  }
303 
304  LOG(VB_GENERAL, LOG_INFO, sidStr.arg((*it).id)
305  .arg((*it).name)
306  .arg(xmltv_grabber));
307 
308  query.prepare(
309  "SELECT COUNT(chanid) FROM channel "
310  "WHERE deleted IS NULL AND "
311  " sourceid = :SRCID AND xmltvid != ''");
312  query.bindValue(":SRCID", (*it).id);
313 
314  if (query.exec() && query.next())
315  {
316  source_channels = query.value(0).toInt();
317  if (source_channels > 0)
318  {
319  LOG(VB_GENERAL, LOG_INFO,
320  QString("Found %1 channels for source %2 which use grabber")
321  .arg(source_channels).arg((*it).id));
322  }
323  else
324  {
325  LOG(VB_GENERAL, LOG_INFO,
326  QString("No channels are configured to use grabber."));
327  }
328  }
329  else
330  {
331  source_channels = 0;
332  LOG(VB_GENERAL, LOG_INFO,
333  QString("Can't get a channel count for source id %1")
334  .arg((*it).id));
335  }
336 
337  bool hasprefmethod = false;
338 
339  if (is_grabber_external(xmltv_grabber))
340  {
341  uint flags = kMSRunShell | kMSStdOut;
342  MythSystemLegacy grabber_capabilities_proc(xmltv_grabber,
343  QStringList("--capabilities"),
344  flags);
345  grabber_capabilities_proc.Run(25);
346  if (grabber_capabilities_proc.Wait() != GENERIC_EXIT_OK)
347  {
348  LOG(VB_GENERAL, LOG_ERR,
349  QString("%1 --capabilities failed or we timed out waiting."
350  " You may need to upgrade your xmltv grabber")
351  .arg(xmltv_grabber));
352  }
353  else
354  {
355  QByteArray result = grabber_capabilities_proc.ReadAll();
356  QTextStream ostream(result);
357  QString capabilities;
358  while (!ostream.atEnd())
359  {
360  QString capability
361  = ostream.readLine().simplified();
362 
363  if (capability.isEmpty())
364  continue;
365 
366  capabilities += capability + ' ';
367 
368  if (capability == "baseline")
369  (*it).xmltvgrabber_baseline = true;
370 
371  if (capability == "manualconfig")
372  (*it).xmltvgrabber_manualconfig = true;
373 
374  if (capability == "cache")
375  (*it).xmltvgrabber_cache = true;
376 
377  if (capability == "preferredmethod")
378  hasprefmethod = true;
379  }
380  LOG(VB_GENERAL, LOG_INFO,
381  QString("Grabber has capabilities: %1") .arg(capabilities));
382  }
383  }
384 
385  if (hasprefmethod)
386  {
387  uint flags = kMSRunShell | kMSStdOut;
388  MythSystemLegacy grabber_method_proc(xmltv_grabber,
389  QStringList("--preferredmethod"),
390  flags);
391  grabber_method_proc.Run(15);
392  if (grabber_method_proc.Wait() != GENERIC_EXIT_OK)
393  {
394  LOG(VB_GENERAL, LOG_ERR,
395  QString("%1 --preferredmethod failed or we timed out "
396  "waiting. You may need to upgrade your xmltv "
397  "grabber").arg(xmltv_grabber));
398  }
399  else
400  {
401  QTextStream ostream(grabber_method_proc.ReadAll());
402  (*it).xmltvgrabber_prefmethod =
403  ostream.readLine().simplified();
404 
405  LOG(VB_GENERAL, LOG_INFO, QString("Grabber prefers method: %1")
406  .arg((*it).xmltvgrabber_prefmethod));
407  }
408  }
409 
410  m_needPostGrabProc |= true;
411 
412  if ((*it).xmltvgrabber_prefmethod == "allatonce" && !m_noAllAtOnce)
413  {
414  if (!GrabData(*it, 0))
415  ++failures;
416  }
417  else if ((*it).xmltvgrabber_baseline)
418  {
419 
420  QDate qCurrentDate = MythDate::current().date();
421 
422  // We'll keep grabbing until it returns nothing
423  // Max days currently supported is 21
424  int grabdays = REFRESH_MAX;
425 
426  grabdays = (m_maxDays > 0) ? m_maxDays : grabdays;
427  grabdays = (m_onlyUpdateChannels) ? 1 : grabdays;
428 
429  vector<bool> refresh_request;
430  refresh_request.resize(grabdays, m_refreshAll);
431  if (!m_refreshAll)
432  {
433  // Set up days to grab if all is not specified
434  // If all was specified the vector was initialized
435  // with true in all occurrences.
436  for (int i = 0; i < grabdays; i++)
437  refresh_request[i] = m_refreshDay[i];
438  }
439 
440  for (int i = 0; i < grabdays; i++)
441  {
442  if (!m_fatalErrors.empty())
443  break;
444 
445  // We need to check and see if the current date has changed
446  // since we started in this loop. If it has, we need to adjust
447  // the value of 'i' to compensate for this.
448  if (MythDate::current().date() != qCurrentDate)
449  {
450  QDate newDate = MythDate::current().date();
451  i += (newDate.daysTo(qCurrentDate));
452  if (i < 0)
453  i = 0;
454  qCurrentDate = newDate;
455  }
456 
457  QString prevDate(qCurrentDate.addDays(i-1).toString());
458  QString currDate(qCurrentDate.addDays(i).toString());
459 
460  LOG(VB_GENERAL, LOG_INFO, ""); // add a space between days
461  LOG(VB_GENERAL, LOG_INFO, "Checking day @ " +
462  QString("offset %1, date: %2").arg(i).arg(currDate));
463 
464  bool download_needed = false;
465 
466  if (refresh_request[i])
467  {
468  if ( i == 1 )
469  {
470  LOG(VB_GENERAL, LOG_INFO,
471  "Data Refresh always needed for tomorrow");
472  }
473  else
474  {
475  LOG(VB_GENERAL, LOG_INFO,
476  "Data Refresh needed because of user request");
477  }
478  download_needed = true;
479  }
480  else
481  {
482  // Check to see if we already downloaded data for this date.
483 
484  querystr = "SELECT c.chanid, COUNT(p.starttime) "
485  "FROM channel c "
486  "LEFT JOIN program p ON c.chanid = p.chanid "
487  " AND starttime >= "
488  "DATE_ADD(DATE_ADD(CURRENT_DATE(), "
489  "INTERVAL '%1' DAY), INTERVAL '20' HOUR) "
490  " AND starttime < DATE_ADD(CURRENT_DATE(), "
491  "INTERVAL '%2' DAY) "
492  "WHERE c.deleted IS NULL AND c.sourceid = %3 AND c.xmltvid != '' "
493  "GROUP BY c.chanid;";
494 
495  if (query.exec(querystr.arg(i-1).arg(i).arg((*it).id)) &&
496  query.isActive())
497  {
498  int prevChanCount = 0;
499  int currentChanCount = 0;
500  int previousDayCount = 0;
501  int currentDayCount = 0;
502 
503  LOG(VB_CHANNEL, LOG_INFO,
504  QString("Checking program counts for day %1")
505  .arg(i-1));
506 
507  while (query.next())
508  {
509  if (query.value(1).toInt() > 0)
510  prevChanCount++;
511  previousDayCount += query.value(1).toInt();
512 
513  LOG(VB_CHANNEL, LOG_INFO,
514  QString(" chanid %1 -> %2 programs")
515  .arg(query.value(0).toString())
516  .arg(query.value(1).toInt()));
517  }
518 
519  if (query.exec(querystr.arg(i).arg(i+1).arg((*it).id))
520  && query.isActive())
521  {
522  LOG(VB_CHANNEL, LOG_INFO,
523  QString("Checking program counts for day %1")
524  .arg(i));
525  while (query.next())
526  {
527  if (query.value(1).toInt() > 0)
528  currentChanCount++;
529  currentDayCount += query.value(1).toInt();
530 
531  LOG(VB_CHANNEL, LOG_INFO,
532  QString(" chanid %1 -> %2 programs")
533  .arg(query.value(0).toString())
534  .arg(query.value(1).toInt()));
535  }
536  }
537  else
538  {
539  LOG(VB_GENERAL, LOG_INFO,
540  QString("Data Refresh because we are unable to "
541  "query the data for day %1 to "
542  "determine if we have enough").arg(i));
543  download_needed = true;
544  }
545 
546  if (currentChanCount < (prevChanCount * 0.90))
547  {
548  LOG(VB_GENERAL, LOG_INFO,
549  QString("Data refresh needed because only %1 "
550  "out of %2 channels have at least one "
551  "program listed for day @ offset %3 "
552  "from 8PM - midnight. Previous day "
553  "had %4 channels with data in that "
554  "time period.")
555  .arg(currentChanCount).arg(source_channels)
556  .arg(i).arg(prevChanCount));
557  download_needed = true;
558  }
559  else if (currentDayCount == 0)
560  {
561  LOG(VB_GENERAL, LOG_INFO,
562  QString("Data refresh needed because no data "
563  "exists for day @ offset %1 from 8PM - "
564  "midnight.").arg(i));
565  download_needed = true;
566  }
567  else if (previousDayCount == 0)
568  {
569  LOG(VB_GENERAL, LOG_INFO,
570  QString("Data refresh needed because no data "
571  "exists for day @ offset %1 from 8PM - "
572  "midnight. Unable to calculate how "
573  "much we should have for the current "
574  "day so a refresh is being forced.")
575  .arg(i-1));
576  download_needed = true;
577  }
578  else if (currentDayCount < (currentChanCount * 3))
579  {
580  LOG(VB_GENERAL, LOG_INFO,
581  QString("Data Refresh needed because offset "
582  "day %1 has less than 3 programs "
583  "per channel for the 8PM - midnight "
584  "time window for channels that "
585  "normally have data. "
586  "We want at least %2 programs, but "
587  "only found %3")
588  .arg(i).arg(currentChanCount * 3)
589  .arg(currentDayCount));
590  download_needed = true;
591  }
592  else if (currentDayCount < (previousDayCount / 2))
593  {
594  LOG(VB_GENERAL, LOG_INFO,
595  QString("Data Refresh needed because offset "
596  "day %1 has less than half the number "
597  "of programs as the previous day for "
598  "the 8PM - midnight time window. "
599  "We want at least %2 programs, but "
600  "only found %3").arg(i)
601  .arg(previousDayCount / 2)
602  .arg(currentDayCount));
603  download_needed = true;
604  }
605  }
606  else
607  {
608  LOG(VB_GENERAL, LOG_INFO,
609  QString("Data Refresh needed because we are unable "
610  "to query the data for day @ offset %1 to "
611  "determine how much we should have for "
612  "offset day %2.").arg(i-1).arg(i));
613  download_needed = true;
614  }
615  }
616 
617  if (download_needed)
618  {
619  LOG(VB_GENERAL, LOG_NOTICE,
620  QString("Refreshing data for ") + currDate);
621  if (!GrabData(*it, i))
622  {
623  ++failures;
624  if (!m_fatalErrors.empty() || m_interrupted)
625  {
626  break;
627  }
628  }
629 
630  if (m_endOfData)
631  {
632  LOG(VB_GENERAL, LOG_INFO,
633  "Grabber is no longer returning program data, "
634  "finishing");
635  break;
636  }
637  }
638  else
639  {
640  LOG(VB_GENERAL, LOG_NOTICE,
641  QString("Data is already present for ") + currDate +
642  ", skipping");
643  }
644  }
645  if (!m_fatalErrors.empty())
646  break;
647  }
648  else
649  {
650  LOG(VB_GENERAL, LOG_ERR,
651  QString("Grabbing XMLTV data using ") + xmltv_grabber +
652  " is not supported. You may need to upgrade to"
653  " the latest version of XMLTV.");
654  }
655 
656  if (m_interrupted)
657  {
658  break;
659  }
660 
661  query.prepare("SELECT MAX(endtime) FROM program p "
662  "LEFT JOIN channel c ON p.chanid=c.chanid "
663  "WHERE c.deleted IS NULL AND c.sourceid= :SRCID "
664  "AND manualid = 0 AND c.xmltvid != '';");
665  query.bindValue(":SRCID", (*it).id);
666 
667  if (query.exec() && query.next())
668  {
669  if (!query.isNull(0))
670  GuideDataAfter = MythDate::fromString(query.value(0).toString());
671  }
672 
673  if (GuideDataAfter == GuideDataBefore)
674  {
675  nonewdata++;
676  }
677  }
678 
679  if (!m_fatalErrors.empty())
680  {
681  for (int i = 0; i < m_fatalErrors.size(); i++)
682  {
683  LOG(VB_GENERAL, LOG_CRIT, LOC + "Encountered Fatal Error: " +
684  m_fatalErrors[i]);
685  }
686  return false;
687  }
688 
689  if (m_onlyUpdateChannels && !m_needPostGrabProc)
690  return true;
691 
692  if (failures == 0)
693  {
694  if (nonewdata > 0 &&
695  (total_sources != externally_handled))
696  {
697  status = QObject::tr(
698  "mythfilldatabase ran, but did not insert "
699  "any new data into the Guide for %1 of %2 sources. "
700  "This can indicate a potential grabber failure.")
701  .arg(nonewdata)
702  .arg(total_sources);
703  }
704  else
705  {
706  status = QObject::tr("Successful.");
707  }
708 
709  updateLastRunStatus(status);
710  }
711 
712  return (failures == 0);
713 }
714 
715 /* vim: set expandtab tabstop=4 shiftwidth=4: */
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:783
vector< Source > SourceList
Definition: filldata.h:40
void Run(time_t timeout=0)
Runs a command inside the /bin/sh shell. Returns immediately.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:864
bool GrabDataFromFile(int id, QString &filename)
Definition: filldata.cpp:90
#define GENERIC_EXIT_OK
Exited with no error.
Definition: exitcodes.h:10
QString xmltvgrabber_prefmethod
Definition: filldata.h:37
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:30
bool Run(SourceList &sourcelist)
Goes through the sourcelist and updates its channels with program info grabbed with the associated gr...
Definition: filldata.cpp:223
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
bool updateLastRunEnd(void)
Definition: filldata.cpp:40
#define GENERIC_EXIT_KILLED
Process killed or stopped.
Definition: exitcodes.h:23
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
static void HandlePrograms(uint sourceid, QMap< QString, QList< ProgInfo > > &proglist)
Called from mythfilldatabase to bulk insert data into the program database.
#define LOC
Definition: filldata.cpp:36
int id
Definition: filldata.h:28
QString GetConfDir(void)
Definition: mythdirs.cpp:224
QVariant value(int i) const
Definition: mythdbcon.h:198
#define REFRESH_MAX
Definition: filldata.h:18
MSqlQuery query(MSqlQuery::InitCon())
#define VERBOSE_LEVEL_CHECK(_MASK_, _LEVEL_)
Definition: mythlogging.h:14
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
QByteArray & ReadAll()
bool isActive(void) const
Definition: mythdbcon.h:204
unsigned int uint
Definition: compat.h:140
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
uint myth_system(const QString &command, uint flags, uint timeout)
uint Wait(time_t timeout=0)
QString name
Definition: filldata.h:29
run process through shell
Definition: mythsystem.h:41
QString createTempFile(QString name_template, bool dir)
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:808
QString xmltvgrabber
Definition: filldata.h:30
bool updateLastRunStatus(QString &status)
Definition: filldata.cpp:57
bool GrabData(const Source &source, int offset)
Definition: filldata.cpp:111
Default UTC.
Definition: mythdate.h:14
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
bool SaveSettingOnHost(const QString &key, const QString &newValue, const QString &host)
bool updateNextScheduledRun()
Definition: filldata.cpp:64
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:179
bool isNull(int field) const
Definition: mythdbcon.h:208
vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:133
static bool is_grabber_external(const QString &grabber)
Definition: videosource.h:29
bool updateLastRunStart(void)
Definition: filldata.cpp:48
allow access to stdout
Definition: mythsystem.h:39
void SetRefresh(int day, bool set)
Definition: filldata.cpp:72
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23