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