MythTV  master
xmltvparser.cpp
Go to the documentation of this file.
1 #include "xmltvparser.h"
2 
3 // Qt headers
4 #include <QFile>
5 #include <QStringList>
6 #include <QDateTime>
7 #include <QDomDocument>
8 #include <QUrl>
9 
10 // C++ headers
11 #include <iostream>
12 #include <cstdlib>
13 
14 // libmyth headers
15 #include "exitcodes.h"
16 #include "mythcorecontext.h"
17 #include "mythdate.h"
18 
19 // libmythtv headers
20 #include "programinfo.h"
21 #include "programdata.h"
22 #include "dvbdescriptors.h"
23 #include "channelinfo.h"
24 
25 // libmythmetadata headers
26 #include "metadatadownload.h"
27 
28 // filldata headers
29 #include "channeldata.h"
30 #include "fillutil.h"
31 
32 XMLTVParser::XMLTVParser() : current_year(0)
33 {
34  current_year = MythDate::current().date().toString("yyyy").toUInt();
35 }
36 
38 {
41 }
42 
43 static uint ELFHash(const QByteArray &ba)
44 {
45  const uchar *k = (const uchar *)ba.data();
46  uint h = 0;
47  uint g;
48 
49  if (k)
50  {
51  while (*k)
52  {
53  h = (h << 4) + *k++;
54  if ((g = (h & 0xf0000000)) != 0)
55  h ^= g >> 24;
56  h &= ~g;
57  }
58  }
59 
60  return h;
61 }
62 
63 static QString getFirstText(QDomElement element)
64 {
65  for (QDomNode dname = element.firstChild(); !dname.isNull();
66  dname = dname.nextSibling())
67  {
68  QDomText t = dname.toText();
69  if (!t.isNull())
70  return t.data();
71  }
72  return QString();
73 }
74 
75 ChannelInfo *XMLTVParser::parseChannel(QDomElement &element, QUrl &baseUrl)
76 {
77  ChannelInfo *chaninfo = new ChannelInfo;
78 
79  QString xmltvid = element.attribute("id", "");
80 
81  chaninfo->xmltvid = xmltvid;
82  chaninfo->tvformat = "Default";
83 
84  for (QDomNode child = element.firstChild(); !child.isNull();
85  child = child.nextSibling())
86  {
87  QDomElement info = child.toElement();
88  if (!info.isNull())
89  {
90  if (info.tagName() == "icon")
91  {
92  if (chaninfo->icon.isEmpty())
93  {
94  QString path = info.attribute("src", "");
95  if (!path.isEmpty() && !path.contains("://"))
96  {
97  QString base = baseUrl.toString(QUrl::StripTrailingSlash);
98  chaninfo->icon = base +
99  ((path.startsWith("/")) ? path : QString("/") + path);
100  }
101  else if (!path.isEmpty())
102  {
103  QUrl url(path);
104  if (url.isValid())
105  chaninfo->icon = url.toString();
106  }
107  }
108  }
109  else if (info.tagName() == "display-name")
110  {
111  if (chaninfo->name.isEmpty())
112  {
113  chaninfo->name = info.text();
114  }
115  else if (chaninfo->callsign.isEmpty())
116  {
117  chaninfo->callsign = info.text();
118  }
119  else if (chaninfo->channum.isEmpty())
120  {
121  chaninfo->channum = info.text();
122  }
123  }
124  }
125  }
126 
127  chaninfo->freqid = chaninfo->channum;
128  return chaninfo;
129 }
130 
131 static void fromXMLTVDate(QString &timestr, QDateTime &dt)
132 {
133  // The XMLTV spec requires dates to either be in UTC/GMT or to specify a
134  // valid timezone. We are sticking to the spec and require all grabbers
135  // to comply.
136 
137  if (timestr.isEmpty())
138  {
139  LOG(VB_XMLTV, LOG_ERR, "Found empty Date/Time in XMLTV data, ignoring");
140  return;
141  }
142 
143  QStringList split = timestr.split(" ", QString::SkipEmptyParts);
144  QString ts = split[0];
145  QDate tmpDate;
146  QTime tmpTime;
147  QString tzoffset;
148 
149  // Process the TZ offset (if any)
150  if (split.size() > 1)
151  {
152  tzoffset = split[1];
153  // These shouldn't be required and they aren't ISO 8601 but the
154  // xmltv spec mentions these and just these so handle them just in
155  // case
156  if (tzoffset == "GMT" || tzoffset == "UTC")
157  tzoffset = "+0000";
158  else if (tzoffset == "BST")
159  tzoffset = "+0100";
160  }
161  else
162  {
163  // We will accept a datetime with a trailing Z as being explicit
164  if (ts.endsWith('Z'))
165  {
166  tzoffset = "+0000";
167  ts.truncate(ts.length()-1);
168  }
169  else
170  {
171  tzoffset = "+0000";
172  static bool warned_once_on_implicit_utc = false;
173  if (!warned_once_on_implicit_utc)
174  {
175  LOG(VB_XMLTV, LOG_WARNING, "No explicit time zone found, "
176  "guessing implicit UTC! Please consider enhancing "
177  "the guide source to provide explicit UTC or local "
178  "time instead.");
179  warned_once_on_implicit_utc = true;
180  }
181  }
182  }
183 
184  // Process the date part
185  QString tsDate = ts.left(8);
186  if (tsDate.length() == 8)
187  tmpDate = QDate::fromString(tsDate, "yyyyMMdd");
188  else if (tsDate.length() == 6)
189  tmpDate = QDate::fromString(tsDate, "yyyyMM");
190  else if (tsDate.length() == 4)
191  tmpDate = QDate::fromString(tsDate, "yyyy");
192  if (!tmpDate.isValid())
193  {
194  LOG(VB_XMLTV, LOG_ERR,
195  QString("Invalid datetime (date) in XMLTV data, ignoring: %1")
196  .arg(timestr));
197  return;
198  }
199 
200  // Process the time part (if any)
201  if (ts.length() > 8)
202  {
203  QString tsTime = ts.mid(8);
204  if (tsTime.length() == 6)
205  {
206  if (tsTime == "235960")
207  tsTime = "235959";
208  tmpTime = QTime::fromString(tsTime, "HHmmss");
209  }
210  else if (tsTime.length() == 4)
211  tmpTime = QTime::fromString(tsTime, "HHmm");
212  else if (tsTime.length() == 2)
213  tmpTime = QTime::fromString(tsTime, "HH");
214  if (!tmpTime.isValid())
215  {
216  // Time part exists, but is (somehow) invalid
217  LOG(VB_XMLTV, LOG_ERR,
218  QString("Invalid datetime (time) in XMLTV data, ignoring: %1")
219  .arg(timestr));
220  return;
221  }
222  }
223 
224  QDateTime tmpDT = QDateTime(tmpDate, tmpTime, Qt::UTC);
225  if (!tmpDT.isValid())
226  {
227  LOG(VB_XMLTV, LOG_ERR,
228  QString("Invalid datetime (combination of date/time) "
229  "in XMLTV data, ignoring: %1").arg(timestr));
230  return;
231  }
232 
233  // While this seems like a hack, it's better than what was done before
234  QString isoDateString = tmpDT.toString(Qt::ISODate);
235  if (isoDateString.endsWith('Z')) // Should always be Z, but ...
236  isoDateString.truncate(isoDateString.length()-1);
237  isoDateString += tzoffset;
238  dt = QDateTime::fromString(isoDateString, Qt::ISODate).toUTC();
239 
240  if (!dt.isValid())
241  {
242  LOG(VB_XMLTV, LOG_ERR,
243  QString("Invalid datetime (zone offset) in XMLTV data, "
244  "ignoring: %1").arg(timestr));
245  return;
246  }
247 
249 }
250 
251 static void parseCredits(QDomElement &element, ProgInfo *pginfo)
252 {
253  for (QDomNode child = element.firstChild(); !child.isNull();
254  child = child.nextSibling())
255  {
256  QDomElement info = child.toElement();
257  if (!info.isNull())
258  pginfo->AddPerson(info.tagName(), getFirstText(info));
259  }
260 }
261 
262 static void parseVideo(QDomElement &element, ProgInfo *pginfo)
263 {
264  for (QDomNode child = element.firstChild(); !child.isNull();
265  child = child.nextSibling())
266  {
267  QDomElement info = child.toElement();
268  if (!info.isNull())
269  {
270  if (info.tagName() == "quality")
271  {
272  if (getFirstText(info) == "HDTV")
273  pginfo->videoProps |= VID_HDTV;
274  }
275  else if (info.tagName() == "aspect")
276  {
277  if (getFirstText(info) == "16:9")
278  pginfo->videoProps |= VID_WIDESCREEN;
279  }
280  }
281  }
282 }
283 
284 static void parseAudio(QDomElement &element, ProgInfo *pginfo)
285 {
286  for (QDomNode child = element.firstChild(); !child.isNull();
287  child = child.nextSibling())
288  {
289  QDomElement info = child.toElement();
290  if (!info.isNull())
291  {
292  if (info.tagName() == "stereo")
293  {
294  if (getFirstText(info) == "mono")
295  {
296  pginfo->audioProps |= AUD_MONO;
297  }
298  else if (getFirstText(info) == "stereo")
299  {
300  pginfo->audioProps |= AUD_STEREO;
301  }
302  else if (getFirstText(info) == "dolby" ||
303  getFirstText(info) == "dolby digital")
304  {
305  pginfo->audioProps |= AUD_DOLBY;
306  }
307  else if (getFirstText(info) == "surround")
308  {
309  pginfo->audioProps |= AUD_SURROUND;
310  }
311  }
312  }
313  }
314 }
315 
316 ProgInfo *XMLTVParser::parseProgram(QDomElement &element)
317 {
318  QString programid, season, episode, totalepisodes;
319  ProgInfo *pginfo = new ProgInfo();
320 
321  QString text = element.attribute("start", "");
322  fromXMLTVDate(text, pginfo->starttime);
323  pginfo->startts = text;
324 
325  text = element.attribute("stop", "");
326  fromXMLTVDate(text, pginfo->endtime);
327  pginfo->endts = text;
328 
329  text = element.attribute("channel", "");
330  QStringList split = text.split(" ");
331 
332  pginfo->channel = split[0];
333 
334  text = element.attribute("clumpidx", "");
335  if (!text.isEmpty())
336  {
337  split = text.split('/');
338  pginfo->clumpidx = split[0];
339  pginfo->clumpmax = split[1];
340  }
341 
342  for (QDomNode child = element.firstChild(); !child.isNull();
343  child = child.nextSibling())
344  {
345  QDomElement info = child.toElement();
346  if (!info.isNull())
347  {
348  if (info.tagName() == "title")
349  {
350  if (info.attribute("lang") == "ja_JP")
351  {
352  pginfo->title = getFirstText(info);
353  }
354  else if (info.attribute("lang") == "ja_JP@kana")
355  {
356  pginfo->title_pronounce = getFirstText(info);
357  }
358  else if (pginfo->title.isEmpty())
359  {
360  pginfo->title = getFirstText(info);
361  }
362  }
363  else if (info.tagName() == "sub-title" &&
364  pginfo->subtitle.isEmpty())
365  {
366  pginfo->subtitle = getFirstText(info);
367  }
368  else if (info.tagName() == "desc" && pginfo->description.isEmpty())
369  {
370  pginfo->description = getFirstText(info);
371  }
372  else if (info.tagName() == "category")
373  {
374  const QString cat = getFirstText(info);
375 
376  if (ProgramInfo::kCategoryNone == pginfo->categoryType &&
378  {
380  }
381  else if (pginfo->category.isEmpty())
382  {
383  pginfo->category = cat;
384  }
385 
386  if ((cat.compare(QObject::tr("movie"),Qt::CaseInsensitive) == 0) ||
387  (cat.compare(QObject::tr("film"),Qt::CaseInsensitive) == 0))
388  {
389  // Hack for tv_grab_uk_rt
391  }
392 
393  pginfo->genres.append(cat);
394  }
395  else if (info.tagName() == "date" && !pginfo->airdate)
396  {
397  // Movie production year
398  QString date = getFirstText(info);
399  pginfo->airdate = date.left(4).toUInt();
400  }
401  else if (info.tagName() == "star-rating" && pginfo->stars == 0.0)
402  {
403  QDomNodeList values = info.elementsByTagName("value");
404  QDomElement item;
405  QString stars;
406  float num, den;
407  float rating = 0.0;
408 
409  // Use the first rating to appear in the xml, this should be
410  // the most important one.
411  //
412  // Averaging is not a good idea here, any subsequent ratings
413  // are likely to represent that days recommended programmes
414  // which on a bad night could given to an average programme.
415  // In the case of uk_rt it's not unknown for a recommendation
416  // to be given to programmes which are 'so bad, you have to
417  // watch!'
418  //
419  // XMLTV uses zero based ratings and signals no rating by absence.
420  // A rating from 1 to 5 is encoded as 0/4 to 4/4.
421  // MythTV uses zero to signal no rating!
422  // The same rating is encoded as 0.2 to 1.0 with steps of 0.2, it
423  // is not encoded as 0.0 to 1.0 with steps of 0.25 because
424  // 0 signals no rating!
425  // See http://xmltv.cvs.sourceforge.net/viewvc/xmltv/xmltv/xmltv.dtd?revision=1.47&view=markup#l539
426  item = values.item(0).toElement();
427  if (!item.isNull())
428  {
429  stars = getFirstText(item);
430  num = stars.section('/', 0, 0).toFloat() + 1;
431  den = stars.section('/', 1, 1).toFloat() + 1;
432  if (0.0 < den)
433  rating = num/den;
434  }
435 
436  pginfo->stars = rating;
437  }
438  else if (info.tagName() == "rating")
439  {
440  // again, the structure of ratings seems poorly represented
441  // in the XML. no idea what we'd do with multiple values.
442  QDomNodeList values = info.elementsByTagName("value");
443  QDomElement item = values.item(0).toElement();
444  if (item.isNull())
445  continue;
447  rating.system = info.attribute("system", "");
448  rating.rating = getFirstText(item);
449  pginfo->ratings.append(rating);
450  }
451  else if (info.tagName() == "previously-shown")
452  {
453  pginfo->previouslyshown = true;
454 
455  QString prevdate = info.attribute("start");
456  if (!prevdate.isEmpty())
457  {
458  QDateTime date;
459  fromXMLTVDate(prevdate, date);
460  pginfo->originalairdate = date.date();
461  }
462  }
463  else if (info.tagName() == "credits")
464  {
465  parseCredits(info, pginfo);
466  }
467  else if (info.tagName() == "subtitles")
468  {
469  if (info.attribute("type") == "teletext")
470  pginfo->subtitleType |= SUB_NORMAL;
471  else if (info.attribute("type") == "onscreen")
472  pginfo->subtitleType |= SUB_ONSCREEN;
473  else if (info.attribute("type") == "deaf-signed")
474  pginfo->subtitleType |= SUB_SIGNED;
475  }
476  else if (info.tagName() == "audio")
477  {
478  parseAudio(info, pginfo);
479  }
480  else if (info.tagName() == "video")
481  {
482  parseVideo(info, pginfo);
483  }
484  else if (info.tagName() == "episode-num")
485  {
486  if (info.attribute("system") == "dd_progid")
487  {
488  QString episodenum(getFirstText(info));
489  // if this field includes a dot, strip it out
490  int idx = episodenum.indexOf('.');
491  if (idx != -1)
492  episodenum.remove(idx, 1);
493  programid = episodenum;
494  /* Only EPisodes and SHows are part of a series for SD */
495  if (programid.startsWith(QString("EP")) ||
496  programid.startsWith(QString("SH")))
497  pginfo->seriesId = QString("EP") + programid.mid(2,8);
498  }
499  else if (info.attribute("system") == "xmltv_ns")
500  {
501  int tmp;
502  QString episodenum(getFirstText(info));
503  episode = episodenum.section('.',1,1);
504  totalepisodes = episode.section('/',1,1).trimmed();
505  episode = episode.section('/',0,0).trimmed();
506  season = episodenum.section('.',0,0).trimmed();
507  season = season.section('/',0,0).trimmed();
508  QString part(episodenum.section('.',2,2));
509  QString partnumber(part.section('/',0,0).trimmed());
510  QString parttotal(part.section('/',1,1).trimmed());
511 
513 
514  if (!season.isEmpty())
515  {
516  tmp = season.toUInt() + 1;
517  pginfo->season = tmp;
518  season = QString::number(tmp);
519  pginfo->syndicatedepisodenumber = QString('S' + season);
520  }
521 
522  if (!episode.isEmpty())
523  {
524  tmp = episode.toUInt() + 1;
525  pginfo->episode = tmp;
526  episode = QString::number(tmp);
527  pginfo->syndicatedepisodenumber.append(QString('E' + episode));
528  }
529 
530  if (!totalepisodes.isEmpty())
531  {
532  pginfo->totalepisodes = totalepisodes.toUInt();
533  }
534 
535  uint partno = 0;
536  if (!partnumber.isEmpty())
537  {
538  bool ok;
539  partno = partnumber.toUInt(&ok) + 1;
540  partno = (ok) ? partno : 0;
541  }
542 
543  if (!parttotal.isEmpty() && partno > 0)
544  {
545  bool ok;
546  uint partto = parttotal.toUInt(&ok);
547  if (ok && partnumber <= parttotal)
548  {
549  pginfo->parttotal = partto;
550  pginfo->partnumber = partno;
551  }
552  }
553  }
554  else if (info.attribute("system") == "onscreen")
555  {
557  if (pginfo->subtitle.isEmpty())
558  {
559  pginfo->subtitle = getFirstText(info);
560  }
561  }
562  else if ((info.attribute("system") == "themoviedb.org") &&
563  (_movieGrabberPath.endsWith(QString("/tmdb3.py"))))
564  {
565  /* text is movie/<inetref> */
566  QString inetrefRaw(getFirstText(info));
567  if (inetrefRaw.startsWith(QString("movie/"))) {
568  QString inetref(QString ("tmdb3.py_") + inetrefRaw.section('/',1,1).trimmed());
569  pginfo->inetref = inetref;
570  }
571  }
572  else if ((info.attribute("system") == "thetvdb.com") &&
573  (_tvGrabberPath.endsWith(QString("/ttvdb.py"))))
574  {
575  /* text is series/<inetref> */
576  QString inetrefRaw(getFirstText(info));
577  if (inetrefRaw.startsWith(QString("series/"))) {
578  QString inetref(QString ("ttvdb.py_") + inetrefRaw.section('/',1,1).trimmed());
579  pginfo->inetref = inetref;
580  /* ProgInfo does not have a collectionref, so we don't set any */
581  }
582  }
583  }
584  }
585  }
586 
587  if (pginfo->category.isEmpty() &&
590 
591  if (!pginfo->airdate
593  pginfo->airdate = current_year;
594 
595  if (programid.isEmpty())
596  {
597 
598  /* Let's build ourself a programid */
599 
601  programid = "MV";
602  else if (ProgramInfo::kCategorySeries == pginfo->categoryType)
603  programid = "EP";
604  else if (ProgramInfo::kCategorySports == pginfo->categoryType)
605  programid = "SP";
606  else
607  programid = "SH";
608 
609  QString seriesid = QString::number(ELFHash(pginfo->title.toUtf8()));
610  pginfo->seriesId = seriesid;
611  programid.append(seriesid);
612 
613  if (!episode.isEmpty() && !season.isEmpty())
614  {
615  /* Append unpadded episode and season number to the seriesid (to
616  maintain consistency with historical encoding), but limit the
617  season number representation to a single base-36 character to
618  ensure unique programid generation. */
619  int season_int = season.toInt();
620  if (season_int > 35)
621  {
622  // Cannot represent season as a single base-36 character, so
623  // remove the programid and fall back to normal dup matching.
625  programid.clear();
626  }
627  else
628  {
629  programid.append(episode);
630  programid.append(QString::number(season_int, 36));
631  if (pginfo->partnumber && pginfo->parttotal)
632  {
633  programid += QString::number(pginfo->partnumber);
634  programid += QString::number(pginfo->parttotal);
635  }
636  }
637  }
638  else
639  {
640  /* No ep/season info? Well then remove the programid and rely on
641  normal dupchecking methods instead. */
643  programid.clear();
644  }
645  }
646 
647  pginfo->programId = programid;
648 
649  return pginfo;
650 }
651 
653  QString filename, ChannelInfoList *chanlist,
654  QMap<QString, QList<ProgInfo> > *proglist)
655 {
656  QDomDocument doc;
657  QFile f;
658 
659  if (!dash_open(f, filename, QIODevice::ReadOnly))
660  {
661  LOG(VB_GENERAL, LOG_ERR,
662  QString("Error unable to open '%1' for reading.") .arg(filename));
663  return false;
664  }
665 
666  QString errorMsg = "unknown";
667  int errorLine = 0;
668  int errorColumn = 0;
669 
670  if (!doc.setContent(&f, &errorMsg, &errorLine, &errorColumn))
671  {
672  LOG(VB_GENERAL, LOG_ERR, QString("Error in %1:%2: %3")
673  .arg(errorLine).arg(errorColumn).arg(errorMsg));
674 
675  f.close();
676  return true;
677  }
678 
679  f.close();
680 
681  QDomElement docElem = doc.documentElement();
682 
683  QUrl baseUrl(docElem.attribute("source-data-url", ""));
684  //QUrl sourceUrl(docElem.attribute("source-info-url", ""));
685 
686  QString aggregatedTitle;
687  QString aggregatedDesc;
688 
689  QDomNode n = docElem.firstChild();
690  while (!n.isNull())
691  {
692  QDomElement e = n.toElement();
693  if (!e.isNull())
694  {
695  if (e.tagName() == "channel")
696  {
697  ChannelInfo *chinfo = parseChannel(e, baseUrl);
698  if (!chinfo->xmltvid.isEmpty())
699  chanlist->push_back(*chinfo);
700  delete chinfo;
701  }
702  else if (e.tagName() == "programme")
703  {
704  ProgInfo *pginfo = parseProgram(e);
705 
706  if (!(pginfo->starttime.isValid()))
707  {
708  LOG(VB_GENERAL, LOG_WARNING, QString("Invalid programme (%1), "
709  "invalid start time, "
710  "skipping")
711  .arg(pginfo->title));
712  }
713  else if (pginfo->channel.isEmpty())
714  {
715  LOG(VB_GENERAL, LOG_WARNING, QString("Invalid programme (%1), "
716  "missing channel, "
717  "skipping")
718  .arg(pginfo->title));
719  }
720  else if (pginfo->startts == pginfo->endts)
721  {
722  LOG(VB_GENERAL, LOG_WARNING, QString("Invalid programme (%1), "
723  "identical start and end "
724  "times, skipping")
725  .arg(pginfo->title));
726  }
727  else
728  {
729  if (pginfo->clumpidx.isEmpty())
730  (*proglist)[pginfo->channel].push_back(*pginfo);
731  else
732  {
733  /* append all titles/descriptions from one clump */
734  if (pginfo->clumpidx.toInt() == 0)
735  {
736  aggregatedTitle.clear();
737  aggregatedDesc.clear();
738  }
739 
740  if (!pginfo->title.isEmpty())
741  {
742  if (!aggregatedTitle.isEmpty())
743  aggregatedTitle.append(" | ");
744  aggregatedTitle.append(pginfo->title);
745  }
746 
747  if (!pginfo->description.isEmpty())
748  {
749  if (!aggregatedDesc.isEmpty())
750  aggregatedDesc.append(" | ");
751  aggregatedDesc.append(pginfo->description);
752  }
753  if (pginfo->clumpidx.toInt() ==
754  pginfo->clumpmax.toInt() - 1)
755  {
756  pginfo->title = aggregatedTitle;
757  pginfo->description = aggregatedDesc;
758  (*proglist)[pginfo->channel].push_back(*pginfo);
759  }
760  }
761  }
762  delete pginfo;
763  }
764  }
765  n = n.nextSibling();
766  }
767 
768  return true;
769 }
unsigned char audioProps
Definition: programdata.h:176
QString system
Definition: programdata.h:69
bool dash_open(QFile &file, const QString &filename, int m, FILE *handle)
Definition: fillutil.cpp:11
uint episode
Definition: programdata.h:188
static void parseVideo(QDomElement &element, ProgInfo *pginfo)
QString endts
Definition: programdata.h:268
QString title_pronounce
Definition: programdata.h:269
QString channum
Definition: channelinfo.h:78
unsigned int current_year
Definition: xmltvparser.h:28
QString tvformat
Definition: channelinfo.h:96
QString freqid
Definition: channelinfo.h:79
uint season
Definition: programdata.h:187
QString _tvGrabberPath
Definition: xmltvparser.h:30
QList< EventRating > ratings
Definition: programdata.h:185
unsigned char subtitleType
Definition: programdata.h:175
uint16_t parttotal
Definition: programdata.h:173
Default UTC, "yyyyMMddhhmmss".
Definition: mythdate.h:15
const char * filename
Definition: ioapi.h:135
unsigned int uint
Definition: compat.h:136
static void parseCredits(QDomElement &element, ProgInfo *pginfo)
bool parseFile(QString filename, ChannelInfoList *chanlist, QMap< QString, QList< ProgInfo > > *proglist)
QString subtitle
Definition: programdata.h:164
void lateInit()
Definition: xmltvparser.cpp:37
ProgramInfo::CategoryType string_to_myth_category_type(const QString &category_type)
QString programId
Definition: programdata.h:181
bool previouslyshown
Definition: programdata.h:183
float stars
Definition: programdata.h:178
const QString season
Definition: eitfixup.cpp:21
static void parseAudio(QDomElement &element, ProgInfo *pginfo)
QString rating
Definition: programdata.h:70
QString callsign
Definition: channelinfo.h:82
def rating(profile, smoonURL, gate)
Definition: scan.py:25
QString clumpmax
Definition: programdata.h:273
QString _movieGrabberPath
Definition: xmltvparser.h:29
QString startts
Definition: programdata.h:267
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
unsigned char t
Definition: ParseText.cpp:340
QString title
Definition: programdata.h:163
QString description
Definition: programdata.h:165
QStringList genres
Definition: programdata.h:186
QString seriesId
Definition: programdata.h:180
ProgInfo * parseProgram(QDomElement &element)
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:72
static QString GetTelevisionGrabber()
static uint ELFHash(const QByteArray &ba)
Definition: xmltvparser.cpp:43
QString syndicatedepisodenumber
Definition: programdata.h:174
QString myth_category_type_to_string(ProgramInfo::CategoryType category_type)
vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:121
QString category
Definition: programdata.h:166
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:38
uint16_t airdate
movie year / production year
Definition: programdata.h:169
QDateTime starttime
Definition: programdata.h:167
ChannelInfo * parseChannel(QDomElement &element, QUrl &baseUrl)
Definition: xmltvparser.cpp:75
QString clumpidx
Definition: programdata.h:272
uint totalepisodes
Definition: programdata.h:189
static void fromXMLTVDate(QString &timestr, QDateTime &dt)
QString icon
Definition: channelinfo.h:84
uint16_t partnumber
Definition: programdata.h:172
QDate originalairdate
origial broadcast date
Definition: programdata.h:170
QString name
Definition: channelinfo.h:83
unsigned char videoProps
Definition: programdata.h:177
QString xmltvid
Definition: channelinfo.h:88
ProgramInfo::CategoryType categoryType
Definition: programdata.h:179
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:34
QDateTime endtime
Definition: programdata.h:168
static QString GetMovieGrabber()
Default UTC.
Definition: mythdate.h:14
void AddPerson(DBPerson::Role, const QString &name)
QString inetref
Definition: programdata.h:182
static QString getFirstText(QDomElement element)
Definition: xmltvparser.cpp:63
QString channel
Definition: programdata.h:266
unsigned char g
Definition: ParseText.cpp:340