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