MythTV  master
recordingrule.cpp
Go to the documentation of this file.
1 
2 #include "recordingrule.h"
3 
4 #include <utility>
5 
6 // libmythbase
8 #include "libmythbase/mythdate.h"
9 #include "libmythbase/mythdb.h"
11 
12 // libmythtv
13 #include "scheduledrecording.h" // For RescheduleMatch()
14 #include "playgroup.h" // For GetInitialName()
15 #include "recordingprofile.h" // For constants
16 
17 static inline QString null_to_empty(const QString &str)
18 {
19  return str.isEmpty() ? "" : str;
20 }
21 
22 // If the GetNumSetting() calls here are ever removed, update schema
23 // upgrade 1302 in dbcheck.cpp to manually apply them to the Default
24 // template. Failing to do so will cause users upgrading from older
25 // versions to lose those settings.
26 
28  : m_findtime(QTime::fromString("00:00:00", Qt::ISODate)),
29  m_findid(QDate(1970, 1, 1).daysTo(MythDate::current().toLocalTime().date())
30  + 719528),
31  m_transcoder(RecordingProfile::kTranscoderAutodetect)
32 {
33  QDateTime dt = MythDate::current();
34  m_enddate = m_startdate = dt.date();
35  m_endtime = m_starttime = dt.time();
36 
38 }
39 
44 {
45  std::shared_ptr<MythSortHelper>sh = getMythSortHelper();
46 
47  if (m_sortTitle.isEmpty() and not m_title.isEmpty())
48  m_sortTitle = sh->doTitle(m_title);
49  if (m_sortSubtitle.isEmpty() and not m_subtitle.isEmpty())
50  m_sortSubtitle = sh->doTitle(m_subtitle);
51 }
52 
56 bool RecordingRule::Load(bool asTemplate)
57 {
58  if (m_recordID <= 0)
59  return false;
60 
62  query.prepare("SELECT type, search, " // 00-01
63  "recpriority, prefinput, startoffset, endoffset, dupmethod, dupin, " // 02-07
64  "inactive, profile, recgroup, storagegroup, playgroup, autoexpire, " // 08-13
65  "maxepisodes, maxnewest, autocommflag, autotranscode, transcoder, " // 14-18
66  "autouserjob1, autouserjob2, autouserjob3, autouserjob4, " // 19-22
67  "autometadata, parentid, title, subtitle, description, season, episode, " // 23-29
68  "category, starttime, startdate, endtime, enddate, seriesid, programid, " // 30-36
69  "inetref, chanid, station, findday, findtime, findid, " // 37-42
70  "next_record, last_record, last_delete, avg_delay, filter, recgroupid, " // 43-48
71  "autoextend " // 49
72  "FROM record WHERE recordid = :RECORDID ;");
73 
74  query.bindValue(":RECORDID", m_recordID);
75 
76  if (!query.exec())
77  {
78  MythDB::DBError("SELECT record", query);
79  return false;
80  }
81 
82  if (!query.next())
83  return false;
84 
85  // Schedule
86  if (!asTemplate)
87  {
88  m_type = static_cast<RecordingType>(query.value(0).toInt());
89  m_searchType = static_cast<RecSearchType>(query.value(1).toInt());
90  }
91  m_recPriority = query.value(2).toInt();
92  m_prefInput = query.value(3).toInt();
93  m_startOffset = query.value(4).toInt();
94  m_endOffset = query.value(5).toInt();
95  m_dupMethod = static_cast<RecordingDupMethodType>
96  (query.value(6).toInt());
97  m_dupIn = static_cast<RecordingDupInType>(query.value(7).toInt());
98  m_filter = query.value(47).toUInt();
99  m_isInactive = query.value(8).toBool();
100  m_autoExtend = static_cast<AutoExtendType>(query.value(49).toUInt());
101 
102  // Storage
103  m_recProfile = query.value(9).toString();
104  m_recGroupID = query.value(48).toUInt();
105  m_storageGroup = query.value(11).toString();
106  m_playGroup = query.value(12).toString();
107  m_autoExpire = query.value(13).toBool();
108  m_maxEpisodes = query.value(14).toInt();
109  m_maxNewest = query.value(15).toBool();
110 
111  // Post Process
112  m_autoCommFlag = query.value(16).toBool();
113  m_autoTranscode = query.value(17).toBool();
114  m_transcoder = query.value(18).toInt();
115  m_autoUserJob1 = query.value(19).toBool();
116  m_autoUserJob2 = query.value(20).toBool();
117  m_autoUserJob3 = query.value(21).toBool();
118  m_autoUserJob4 = query.value(22).toBool();
119  m_autoMetadataLookup = query.value(23).toBool();
120 
121  if (!asTemplate)
122  {
123  // Original rule id for override rule
124  m_parentRecID = query.value(24).toInt();
125 
126  // Recording metadata
127  m_title = query.value(25).toString();
128  m_subtitle = query.value(26).toString();
129  m_description = query.value(27).toString();
130  m_season = query.value(28).toUInt();
131  m_episode = query.value(29).toUInt();
132  m_category = query.value(30).toString();
133  m_starttime = query.value(31).toTime();
134  m_startdate = query.value(32).toDate();
135  m_endtime = query.value(33).toTime();
136  m_enddate = query.value(34).toDate();
137  m_seriesid = query.value(35).toString();
138  m_programid = query.value(36).toString();
139  m_inetref = query.value(37).toString();
140 
141  // Associated data for rule types
142  m_channelid = query.value(38).toInt();
143  m_station = query.value(39).toString();
144  m_findday = query.value(40).toInt();
145  m_findtime = query.value(41).toTime();
146  m_findid = query.value(42).toInt();
147 
148  // Statistic fields - Used to generate statistics about particular rules
149  // and influence watch list weighting
150  m_nextRecording = MythDate::as_utc(query.value(43).toDateTime());
151  m_lastRecorded = MythDate::as_utc(query.value(44).toDateTime());
152  m_lastDeleted = MythDate::as_utc(query.value(45).toDateTime());
153  m_averageDelay = query.value(46).toInt();
154  }
155 
158  m_template = (asTemplate || m_isTemplate) ?
159  query.value(30).toString() : "";
160 
161  if (!asTemplate)
162  m_loaded = true;
163 
165  return true;
166 }
167 
169 {
170  if (!proginfo)
171  return false;
172 
173  m_progInfo = proginfo;
174 
175  m_recordID = proginfo->GetRecordingRuleID();
176  if (m_recordID)
177  {
178  if (!Load())
179  return false;
180  }
181  else
182  LoadTemplate(proginfo->GetCategory(), proginfo->GetCategoryTypeString());
183 
184  if (m_type != kTemplateRecord &&
186  {
188  if (!proginfo->GetRecordingRuleID())
190  }
191 
193  m_loaded = true;
194  return true;
195 }
196 
213 bool RecordingRule::LoadBySearch(RecSearchType lsearch, const QString& textname,
214  const QString& forwhat, QString joininfo,
215  ProgramInfo *pginfo)
216 {
217  MSqlQuery query(MSqlQuery::InitCon());
218 
219  int rid = 0;
220  query.prepare("SELECT recordid FROM record WHERE "
221  "search = :SEARCH AND description LIKE :FORWHAT");
222  query.bindValue(":SEARCH", lsearch);
223  query.bindValue(":FORWHAT", forwhat);
224 
225  if (query.exec())
226  {
227  if (query.next())
228  rid = query.value(0).toInt();
229  // else rid is zero, which is valid, we're looking at a new rule
230  }
231  else
232  {
233  MythDB::DBError("loadBySearch", query);
234  return false;
235  }
236 
237  if (rid)
238  {
239  m_recordID = rid;
240  if (!Load())
241  return false;
242  }
243  else
244  {
245  LoadTemplate("Default");
246 
247  QString searchType;
248  m_searchType = lsearch;
249  searchType = SearchTypeToString(m_searchType);
250 
251  QString ltitle = QString("%1 (%2)").arg(textname, searchType);
252  m_title = ltitle;
253  m_sortTitle = nullptr;
254  m_subtitle = m_sortSubtitle = std::move(joininfo);
255  m_description = forwhat;
256 
257  if (pginfo)
258  {
259  m_findday =
260  (pginfo->GetScheduledStartTime().toLocalTime().date()
261  .dayOfWeek() + 1) % 7;
262  m_findtime = pginfo->GetScheduledStartTime().toLocalTime().time();
263  m_findid = QDate(1970, 1, 1).daysTo(
264  pginfo->GetScheduledStartTime().toLocalTime().date()) + 719528;
265  }
266  }
267 
269  m_loaded = true;
270  return true;
271 }
272 
273 bool RecordingRule::LoadTemplate(const QString& category, const QString& categoryType)
274 {
275  QString lcategory = category.isEmpty() ? "Default" : category;
276  QString lcategoryType = categoryType.isEmpty() ? "Default" : categoryType;
277 
278  MSqlQuery query(MSqlQuery::InitCon());
279  query.prepare("SELECT recordid, category, "
280  " (category = :CAT1) AS catmatch, "
281  " (category = :CATTYPE1) AS typematch "
282  "FROM record "
283  "WHERE type = :TEMPLATE AND "
284  " (category = :CAT2 OR category = :CATTYPE2 "
285  " OR category = 'Default') "
286  "ORDER BY catmatch DESC, typematch DESC"
287  );
288  query.bindValue(":TEMPLATE", kTemplateRecord);
289  query.bindValue(":CAT1", lcategory);
290  query.bindValue(":CAT2", lcategory);
291  query.bindValue(":CATTYPE1", lcategoryType);
292  query.bindValue(":CATTYPE2", lcategoryType);
293 
294  if (!query.exec())
295  {
296  MythDB::DBError("LoadByTemplate", query);
297  return false;
298  }
299 
300  if (!query.next())
301  return false;
302 
303  int savedRecordID = m_recordID;
304  m_recordID = query.value(0).toInt();
305  bool result = Load(true);
306  m_recordID = savedRecordID;
307 
308  return result;
309 }
310 
311 bool RecordingRule::MakeTemplate(QString category)
312 {
313  if (m_recordID > 0)
314  return false;
315 
316  if (category.compare(tr("Default"), Qt::CaseInsensitive) == 0)
317  {
318  category = "Default";
319  m_title = tr("Default (Template)");
321  }
322  else
323  {
324  //: %1 is the category
325  m_title = tr("%1 (Template)").arg(category);
327  }
328 
329  LoadTemplate(category);
330  m_recordID = 0;
332  m_category = category;
333  m_loaded = true;
334  m_isTemplate = true;
335 
336  return true;
337 }
338 
339 bool RecordingRule::ModifyPowerSearchByID(int rid, const QString& textname,
340  QString forwhat, QString joininfo)
341 {
342  if (rid <= 0)
343  return false;
344 
345  m_recordID = rid;
346  if (!Load() || m_searchType != kPowerSearch)
347  return false;
348 
349  QString ltitle = QString("%1 (%2)").arg(textname, tr("Power Search"));
350  m_title = ltitle;
351  m_sortTitle = nullptr;
352  m_subtitle = m_sortSubtitle = std::move(joininfo);
353  m_description = std::move(forwhat);
354 
356  m_loaded = true;
357  return true;
358 }
359 
361 {
362  if (m_recordID <= 0)
363  return false;
364 
366  return false;
367 
368  m_isOverride = true;
370  m_recordID = 0;
372  m_isInactive = false;
373 
376 
378 
379  return true;
380 }
381 
382 bool RecordingRule::Save(bool sendSig)
383 {
384  QString sql = "SET type = :TYPE, search = :SEARCHTYPE, "
385  "recpriority = :RECPRIORITY, prefinput = :INPUT, "
386  "startoffset = :STARTOFFSET, endoffset = :ENDOFFSET, "
387  "dupmethod = :DUPMETHOD, dupin = :DUPIN, "
388  "filter = :FILTER, autoextend = :AUTOEXTEND, "
389  "inactive = :INACTIVE, profile = :RECPROFILE, "
390  "recgroup = :RECGROUP, "
391  "recgroupid = :RECGROUPID, "
392  "storagegroup = :STORAGEGROUP, "
393  "playgroup = :PLAYGROUP, autoexpire = :AUTOEXPIRE, "
394  "maxepisodes = :MAXEPISODES, maxnewest = :MAXNEWEST, "
395  "autocommflag = :AUTOCOMMFLAG, "
396  "autotranscode = :AUTOTRANSCODE, "
397  "transcoder = :TRANSCODER, autouserjob1 = :AUTOUSERJOB1, "
398  "autouserjob2 = :AUTOUSERJOB2, "
399  "autouserjob3 = :AUTOUSERJOB3, "
400  "autouserjob4 = :AUTOUSERJOB4, "
401  "autometadata = :AUTOMETADATA, "
402  "parentid = :PARENTID, title = :TITLE, "
403  "subtitle = :SUBTITLE, season = :SEASON, episode = :EPISODE, "
404  "description = :DESCRIPTION, category = :CATEGORY, "
405  "starttime = :STARTTIME, startdate = :STARTDATE, "
406  "endtime = :ENDTIME, enddate = :ENDDATE, seriesid = :SERIESID, "
407  "programid = :PROGRAMID, inetref = :INETREF, chanid = :CHANID, "
408  "station = :STATION, findday = :FINDDAY, "
409  "findtime = :FINDTIME, findid = :FINDID, "
410  "next_record = :NEXTREC, last_record = :LASTREC, "
411  "last_delete = :LASTDELETE, avg_delay = :AVGDELAY ";
412 
413  QString sqlquery;
414  if (m_recordID > 0 || (m_recordTable != "record" && m_tempID > 0))
415  {
416  sqlquery = QString("UPDATE %1 %2 WHERE recordid = :RECORDID;")
417  .arg(m_recordTable, sql);
418  }
419  else
420  {
421  sqlquery = QString("INSERT INTO %1 %2;").arg(m_recordTable, sql);
422  }
423 
424  MSqlQuery query(MSqlQuery::InitCon());
425  query.prepare(sqlquery);
426  query.bindValue(":TYPE", m_type);
427  query.bindValue(":SEARCHTYPE", m_searchType);
428  query.bindValue(":RECPRIORITY", m_recPriority);
429  query.bindValue(":INPUT", m_prefInput);
430  query.bindValue(":STARTOFFSET", m_startOffset);
431  query.bindValue(":ENDOFFSET", m_endOffset);
432  query.bindValue(":DUPMETHOD", m_dupMethod);
433  query.bindValue(":DUPIN", m_dupIn);
434  query.bindValue(":FILTER", m_filter);
435  query.bindValue(":AUTOEXTEND", static_cast<int>(m_autoExtend));
436  query.bindValue(":INACTIVE", m_isInactive);
437  query.bindValue(":RECPROFILE", null_to_empty(m_recProfile));
438  // Temporary, remove once transition to recgroupid is complete
440  query.bindValue(":RECGROUPID", m_recGroupID);
441  query.bindValue(":STORAGEGROUP", null_to_empty(m_storageGroup));
442  query.bindValue(":PLAYGROUP", null_to_empty(m_playGroup));
443  query.bindValue(":AUTOEXPIRE", m_autoExpire);
444  query.bindValue(":MAXEPISODES", m_maxEpisodes);
445  query.bindValue(":MAXNEWEST", m_maxNewest);
446  query.bindValue(":AUTOCOMMFLAG", m_autoCommFlag);
447  query.bindValue(":AUTOTRANSCODE", m_autoTranscode);
448  query.bindValue(":TRANSCODER", m_transcoder);
449  query.bindValue(":AUTOUSERJOB1", m_autoUserJob1);
450  query.bindValue(":AUTOUSERJOB2", m_autoUserJob2);
451  query.bindValue(":AUTOUSERJOB3", m_autoUserJob3);
452  query.bindValue(":AUTOUSERJOB4", m_autoUserJob4);
453  query.bindValue(":AUTOMETADATA", m_autoMetadataLookup);
454  query.bindValue(":PARENTID", m_parentRecID);
455  query.bindValue(":TITLE", m_title);
456  query.bindValue(":SUBTITLE", null_to_empty(m_subtitle));
457  query.bindValue(":DESCRIPTION", null_to_empty(m_description));
458  query.bindValue(":SEASON", m_season);
459  query.bindValue(":EPISODE", m_episode);
460  query.bindValue(":CATEGORY", null_to_empty(m_category));
461  query.bindValue(":STARTTIME", m_starttime);
462  query.bindValue(":STARTDATE", m_startdate);
463  query.bindValue(":ENDTIME", m_endtime);
464  query.bindValue(":ENDDATE", m_enddate);
465  query.bindValue(":SERIESID", null_to_empty(m_seriesid));
466  query.bindValue(":PROGRAMID", null_to_empty(m_programid));
467  query.bindValue(":INETREF", null_to_empty(m_inetref));
468  query.bindValue(":CHANID", m_channelid);
469  query.bindValue(":STATION", null_to_empty(m_station));
470  query.bindValue(":FINDDAY", m_findday);
471  query.bindValue(":FINDTIME", m_findtime);
472  query.bindValue(":FINDID", m_findid);
473  query.bindValue(":NEXTREC", m_nextRecording);
474  query.bindValue(":LASTREC", m_lastRecorded);
475  query.bindValue(":LASTDELETE", m_lastDeleted);
476  query.bindValue(":AVGDELAY", m_averageDelay);
477 
478  if (m_recordTable != "record" && m_tempID > 0)
479  query.bindValue(":RECORDID", m_tempID);
480  else if (m_recordID > 0)
481  query.bindValue(":RECORDID", m_recordID);
482 
483  if (!query.exec())
484  {
485  MythDB::DBError("UPDATE/INSERT record", query);
486  return false;
487  }
488 
489  if (m_recordTable != "record" && m_tempID <= 0)
490  m_tempID = query.lastInsertId().toInt();
491  else if (m_recordID <= 0)
492  m_recordID = query.lastInsertId().toInt();
493 
494  if (sendSig)
496  QString("SaveRule %1").arg(m_title));
497 
498  return true;
499 }
500 
501 bool RecordingRule::Delete(bool sendSig)
502 {
503  if (m_recordID < 0)
504  return false;
505 
506  MSqlQuery query(MSqlQuery::InitCon());
507  query.prepare("DELETE FROM record WHERE recordid = :RECORDID");
508  query.bindValue(":RECORDID", m_recordID);
509  if (!query.exec())
510  {
511  MythDB::DBError("ScheduledRecording::remove -- record", query);
512  return false;
513  }
514 
515  query.prepare("DELETE FROM oldfind WHERE recordid = :RECORDID");
516  query.bindValue(":RECORDID", m_recordID);
517  if (!query.exec())
518  {
519  MythDB::DBError("ScheduledRecording::remove -- oldfind", query);
520  }
521 
523  {
524  query.prepare("DELETE FROM program WHERE manualid = :RECORDID");
525  query.bindValue(":RECORDID", m_recordID);
526  if (!query.exec())
527  {
528  MythDB::DBError("ScheduledRecording::remove -- oldfind", query);
529  }
530  }
531 
532  if (sendSig)
534  QString("DeleteRule %1").arg(m_title));
535 
536  // Set m_recordID to zero, the rule is no longer in the database so it's
537  // not valid. Should you want, this allows a rule to be removed from the
538  // database and then re-inserted with Save()
539  m_recordID = 0;
540 
541  return true;
542 }
543 
544 void RecordingRule::ToMap(InfoMap &infoMap, uint date_format) const
545 {
546  if (m_title == "Default (Template)")
547  {
548  infoMap["title"] = tr("Default (Template)");
549  infoMap["sorttitle"] = tr("Default (Template)");
550  }
551  else
552  {
553  infoMap["title"] = m_title;
554  infoMap["sorttitle"] = m_sortTitle;
555  }
556  infoMap["subtitle"] = m_subtitle;
557  infoMap["sortsubtitle"] = m_sortSubtitle;
558  infoMap["description"] = m_description;
559  infoMap["season"] = QString::number(m_season);
560  infoMap["episode"] = QString::number(m_episode);
561 
562  if (m_category == "Default")
563  infoMap["category"] = tr("Default", "category");
564  else
565  infoMap["category"] = m_category;
566  infoMap["callsign"] = m_station;
567 
568  QDateTime starttm(m_startdate, m_starttime, Qt::UTC);
569  infoMap["starttime"] = MythDate::toString(starttm, date_format | MythDate::kTime);
570  infoMap["startdate"] = MythDate::toString(
571  starttm, date_format | MythDate::kDateFull | MythDate::kSimplify);
572 
573  QDateTime endtm(m_enddate, m_endtime, Qt::UTC);
574  infoMap["endtime"] = MythDate::toString(endtm, date_format | MythDate::kTime);
575  infoMap["enddate"] = MythDate::toString(
576  endtm, date_format | MythDate::kDateFull | MythDate::kSimplify);
577 
578  infoMap["inetref"] = m_inetref;
579  infoMap["chanid"] = QString::number(m_channelid);
580  infoMap["channel"] = m_station;
581 
582  QDateTime startts(m_startdate, m_starttime, Qt::UTC);
583  QDateTime endts(m_enddate, m_endtime, Qt::UTC);
584 
585  int seconds = startts.secsTo(endts);
586  int minutes = seconds / 60;
587  int hours = minutes / 60;
588  minutes = minutes % 60;
589 
590  infoMap["lenmins"] = QCoreApplication::translate("(Common)", "%n minute(s)",
591  "", minutes);
592 
593  QString minstring = QCoreApplication::translate("(Common)", "%n minute(s)",
594  "", minutes);
595 
596  QString hourstring = QCoreApplication::translate("(Common)", "%n hour(s)",
597  "", hours);
598 
599  if (hours > 0)
600  {
601  //: Time duration, %1 is replaced by the hours, %2 by the minutes
602  infoMap["lentime"] = QCoreApplication::translate("(Common)", "%1 %2",
603  "Hours and minutes").arg(hourstring, minstring);
604  }
605  else
606  infoMap["lentime"] = minstring;
607 
608 
609  infoMap["timedate"] = MythDate::toString(
610  startts, date_format | MythDate::kDateTimeFull | MythDate::kSimplify) + " - " +
611  MythDate::toString(endts, date_format | MythDate::kTime);
612 
613  infoMap["shorttimedate"] =
615  startts, date_format | MythDate::kDateTimeShort | MythDate::kSimplify) + " - " +
616  MythDate::toString(endts, date_format | MythDate::kTime);
617 
619  {
620  QDateTime ldt =
621  QDateTime(MythDate::current().toLocalTime().date(), m_findtime,
622  Qt::LocalTime);
623  QString findfrom = MythDate::toString(ldt, date_format | MythDate::kTime);
624  if (m_type == kWeeklyRecord)
625  {
626  int daynum = (m_findday + 5) % 7 + 1;
627  findfrom = QString("%1, %2")
628  .arg(gCoreContext->GetQLocale().dayName(daynum, QLocale::ShortFormat),
629  findfrom);
630  }
631  infoMap["subtitle"] = tr("(%1 or later) %3",
632  "e.g. (Sunday or later) program "
633  "subtitle").arg(findfrom, m_subtitle);
634  }
635 
636  infoMap["searchtype"] = SearchTypeToString(m_searchType);
637  if (m_searchType != kNoSearch)
638  infoMap["searchforwhat"] = m_description;
639 
640  using namespace MythDate;
641  if (m_nextRecording.isValid())
642  {
643  infoMap["nextrecording"] = MythDate::toString(
644  m_nextRecording, date_format | kDateFull | kAddYear);
645  }
646  if (m_lastRecorded.isValid())
647  {
648  infoMap["lastrecorded"] = MythDate::toString(
649  m_lastRecorded, date_format | kDateFull | kAddYear);
650  }
651  if (m_lastDeleted.isValid())
652  {
653  infoMap["lastdeleted"] = MythDate::toString(
654  m_lastDeleted, date_format | kDateFull | kAddYear);
655  }
656 
657  infoMap["ruletype"] = toString(m_type);
658  infoMap["rectype"] = toString(m_type);
659  infoMap["autoextend"] = toString(m_autoExtend);
660 
661  if (m_template == "Default")
662  infoMap["template"] = tr("Default", "Default template");
663  else
664  infoMap["template"] = m_template;
665 }
666 
667 void RecordingRule::UseTempTable(bool usetemp, const QString& table)
668 {
670 
671  if (usetemp)
672  {
673  m_recordTable = table;
674 
675  query.prepare("SELECT GET_LOCK(:LOCK, 2);");
676  query.bindValue(":LOCK", "DiffSchedule");
677  if (!query.exec())
678  {
679  MythDB::DBError("Obtaining lock in testRecording", query);
680  return;
681  }
682 
683  query.prepare(QString("DROP TABLE IF EXISTS %1;").arg(table));
684  if (!query.exec())
685  {
686  MythDB::DBError("Deleting old table in testRecording", query);
687  return;
688  }
689 
690  query.prepare(QString("CREATE TABLE %1 SELECT * FROM record;")
691  .arg(table));
692  if (!query.exec())
693  {
694  MythDB::DBError("Create new temp table", query);
695  return;
696  }
697 
698  query.prepare(QString("ALTER TABLE %1 MODIFY recordid int(10) "
699  "UNSIGNED NOT NULL AUTO_INCREMENT primary key;")
700  .arg(table));
701  if (!query.exec())
702  {
703  MythDB::DBError("Modify recordid column to include "
704  "auto-increment", query);
705  return;
706  }
707 
708  if (m_recordID > 0)
710 
711  Save(false);
712  }
713  else
714  {
715  query.prepare("SELECT RELEASE_LOCK(:LOCK);");
716  query.bindValue(":LOCK", "DiffSchedule");
717  if (!query.exec())
718  {
719  MythDB::DBError("Free lock", query);
720  return;
721  }
722  m_recordTable = "record";
723  m_tempID = 0;
724  }
725 }
726 
728 {
729  if (!m_progInfo)
730  return;
731 
745  if (m_recordID <= 0)
746  {
747  m_findday =
748  (m_progInfo->GetScheduledStartTime().toLocalTime().date()
749  .dayOfWeek() + 1) % 7;
750  m_findtime = m_progInfo->GetScheduledStartTime().toLocalTime().time();
751  m_findid = QDate(1970, 1, 1).daysTo(
752  m_progInfo->GetScheduledStartTime().toLocalTime().date()) + 719528;
753  }
754  else
755  {
756  if (m_findid > 0)
758  else
759  {
760  QDate epoch(1970, 1, 1);
761  m_findid = epoch.daysTo(
762  m_progInfo->GetScheduledStartTime().toLocalTime().date())
763  + 719528;
764  }
765  }
767 
768  if (m_inetref.isEmpty())
769  {
773  }
775 }
776 
778 {
779  MSqlQuery query(MSqlQuery::InitCon());
780  query.prepare("SELECT SUM(1 << filterid) FROM recordfilter "
781  "WHERE filterid >= 0 AND filterid < :NUMFILTERS AND "
782  " TRIM(clause) <> '' AND newruledefault <> 0");
783  query.bindValue(":NUMFILTERS", RecordingRule::kNumFilters);
784  if (!query.exec())
785  {
786  MythDB::DBError("GetDefaultFilter", query);
787  return 0;
788  }
789 
790  if (!query.next())
791  return 0;
792 
793  return query.value(0).toUInt();
794 }
795 
797 {
798  QString searchTypeString;
799 
800  switch (searchType)
801  {
802  case kNoSearch:
803  searchTypeString = ""; // Allow themers to decide what to display
804  break;
805  case kPowerSearch:
806  searchTypeString = tr("Power Search");
807  break;
808  case kTitleSearch:
809  searchTypeString = tr("Title Search");
810  break;
811  case kKeywordSearch:
812  searchTypeString = tr("Keyword Search");
813  break;
814  case kPeopleSearch:
815  searchTypeString = tr("People Search");
816  break;
817  default:
818  searchTypeString = tr("Unknown Search");
819  break;
820  }
821 
822  return searchTypeString;
823 }
824 
826 {
827  QStringList result;
828 
829  MSqlQuery query(MSqlQuery::InitCon());
830  query.prepare("SELECT category "
831  "FROM record "
832  "WHERE type = :TEMPLATE "
833  "ORDER BY category = 'Default' DESC, category"
834  );
835  query.bindValue(":TEMPLATE", kTemplateRecord);
836 
837  if (!query.exec())
838  {
839  MythDB::DBError("LoadByTemplate", query);
840  return result;
841  }
842 
843  while (query.next())
844  result << query.value(0).toString();
845 
846  return result;
847 }
848 
849 bool RecordingRule::IsValid(QString &msg) const
850 {
851  bool isOverride = false;
852  switch (m_type)
853  {
854  case kSingleRecord:
855  case kDailyRecord:
856  case kAllRecord:
857  case kWeeklyRecord:
858  case kOneRecord:
859  case kTemplateRecord:
860  break;
861  case kOverrideRecord:
862  case kDontRecord:
863  isOverride = true;
864  break;
865  case kNotRecording:
866  default:
867  msg = QString("Invalid recording type.");
868  return false;
869  }
870 
871  bool isNormal = false;
872  bool isSearch = false;
873  bool isManual = false;
874  switch (m_searchType)
875  {
876  case kNoSearch:
877  isNormal = true;
878  break;
879  case kPowerSearch:
880  case kTitleSearch:
881  case kKeywordSearch:
882  case kPeopleSearch:
883  isSearch = true;
884  break;
885  case kManualSearch:
886  isManual = true;
887  break;
888  default:
889  msg = QString("Invalid search type.");
890  return false;
891  }
892 
893  if ((isNormal && (m_type == kDailyRecord || m_type == kWeeklyRecord)) ||
894  (isSearch && (m_type != kDailyRecord && m_type != kWeeklyRecord &&
895  m_type != kOneRecord && m_type != kAllRecord)) ||
896  (isManual && (m_type != kDailyRecord && m_type != kWeeklyRecord &&
898  {
899  msg = QString("Invalid recording type/search type.");
900  return false;
901  }
902 
903  if ((m_parentRecID && !isOverride) ||
904  (!m_parentRecID && isOverride))
905  {
906  msg = QString("Invalid parentID/override.");
907  return false;
908  }
909 
910  if (m_title.isEmpty())
911  {
912  msg = QString("Invalid title.");
913  return false;
914  }
915 
916  if (m_searchType == kPowerSearch)
917  {
918  MSqlQuery query(MSqlQuery::InitCon());
919  query.prepare(QString("SELECT NULL FROM (program, channel) "
920  "%1 WHERE %2")
921  .arg(m_subtitle, m_description));
922  if (m_description.contains(';') || !query.exec())
923  {
924  msg = QString("Invalid custom search values.");
925  return false;
926  }
927  }
928  else if (isSearch)
929  {
930  if (m_description.isEmpty())
931  {
932  msg = QString("Invalid search value.");
933  return false;
934  }
935  }
936 
937  if (!isSearch)
938  {
939  if (!m_startdate.isValid() || !m_starttime.isValid() ||
940  !m_enddate.isValid() || !m_endtime.isValid())
941  {
942  msg = QString("Invalid start/end date/time.");
943  return false;
944  }
945  int secsto = QDateTime(m_startdate, m_starttime)
946  .secsTo(QDateTime(m_enddate, m_endtime));
947  if (secsto <= 0 || secsto > (8 * 3600))
948  {
949  msg = QString("Invalid duration.");
950  return false;
951  }
952 
953  if (!m_channelid || m_station.isEmpty())
954  {
955  msg = QString("Invalid channel.");
956  return false;
957  }
958  }
959 
960  if (m_findday < 0 || m_findday > 6 || !m_findtime.isValid())
961  {
962  msg = QString("Invalid find values.");
963  return false;
964  }
965 
966  if (m_recPriority < -99 || m_recPriority > 99)
967  {
968  msg = QString("Invalid priority.");
969  return false;
970  }
971 
972  if (m_startOffset < -480 || m_startOffset > 480 ||
973  m_endOffset < -480 || m_endOffset > 480)
974  {
975  msg = QString("Invalid start/end offset.");
976  return false;
977  }
978 
979  if (m_prefInput < 0)
980  {
981  msg = QString("Invalid preferred input.");
982  return false;
983  }
984 
985  unsigned valid_mask = (1 << kNumFilters) - 1;
986  if ((m_filter & valid_mask) != m_filter)
987  {
988  msg = QString("Invalid filter value.");
989  return false;
990  }
991 
992  if (m_recProfile.isEmpty() || (m_recGroupID == 0) ||
993  m_storageGroup.isEmpty() || m_playGroup.isEmpty())
994  {
995  msg = QString("Invalid group value.");
996  return false;
997  }
998 
999  if (m_maxEpisodes < 0)
1000  {
1001  msg = QString("Invalid max episodes value.");
1002  return false;
1003  }
1004 
1005  if (m_dupIn & ~(kDupsInAll | kDupsNewEpi))
1006  {
1007  msg = QString("Invalid duplicate scope.");
1008  return false;
1009  }
1010 
1013  {
1014  msg = QString("Invalid duplicate method.");
1015  return false;
1016  }
1017 
1018  if (m_transcoder < 0)
1019  {
1020  msg = QString("Invalid transcoder value.");
1021  return false;
1022  }
1023 
1025  {
1026  msg = QString("Invalid auto extend value.");
1027  return false;
1028  }
1029 
1030  return true;
1031 }
RecordingRule::m_isOverride
bool m_isOverride
Definition: recordingrule.h:150
RecordingRule::m_channelid
int m_channelid
callsign?
Definition: recordingrule.h:97
ProgramInfo::GetSortTitle
QString GetSortTitle(void) const
Definition: programinfo.h:362
RecordingRule::LoadTemplate
bool LoadTemplate(const QString &category, const QString &categoryType="Default")
Definition: recordingrule.cpp:273
RecordingRule::LoadByProgram
bool LoadByProgram(const ProgramInfo *proginfo)
Definition: recordingrule.cpp:168
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:807
kDupCheckDesc
@ kDupCheckDesc
Definition: recordingtypes.h:67
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:128
RecordingRule::m_autoTranscode
bool m_autoTranscode
Definition: recordingrule.h:130
RecordingRule::ModifyPowerSearchByID
bool ModifyPowerSearchByID(int rid, const QString &textname, QString forwhat, QString joininfo="")
Definition: recordingrule.cpp:339
RecordingRule::m_enddate
QDate m_enddate
Definition: recordingrule.h:88
RecordingRule::m_recordTable
QString m_recordTable
Definition: recordingrule.h:145
RecordingRule::m_playGroup
QString m_playGroup
Definition: recordingrule.h:120
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:84
RecordingRule::m_seriesid
QString m_seriesid
Definition: recordingrule.h:82
RecordingRule::m_parentRecID
int m_parentRecID
Definition: recordingrule.h:69
RecordingRule::m_description
QString m_description
Definition: recordingrule.h:79
RecordingRule::m_template
QString m_template
Definition: recordingrule.h:161
RecordingRule::m_autoCommFlag
bool m_autoCommFlag
Definition: recordingrule.h:129
RecordingRule::m_inetref
QString m_inetref
Definition: recordingrule.h:85
getMythSortHelper
std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.
Definition: mythsorthelper.cpp:133
mythdb.h
RecordingRule::m_maxNewest
bool m_maxNewest
Definition: recordingrule.h:125
RecordingRule::m_category
QString m_category
Definition: recordingrule.h:80
RecordingRule::Save
bool Save(bool sendSig=true)
Definition: recordingrule.cpp:382
RecordingRule::m_nextRecording
QDateTime m_nextRecording
Definition: recordingrule.h:140
RecordingRule::m_starttime
QTime m_starttime
Definition: recordingrule.h:89
MythDate::as_utc
QDateTime as_utc(const QDateTime &old_dt)
Returns copy of QDateTime with TimeSpec set to UTC.
Definition: mythdate.cpp:27
PlayGroup::GetInitialName
static QString GetInitialName(const ProgramInfo *pi)
Definition: playgroup.cpp:224
RecordingRule::GetDefaultFilter
static unsigned GetDefaultFilter(void)
Definition: recordingrule.cpp:777
kDailyRecord
@ kDailyRecord
Definition: recordingtypes.h:24
kDupCheckSubThenDesc
@ kDupCheckSubThenDesc
Definition: recordingtypes.h:69
RecordingRule::m_progInfo
const ProgramInfo * m_progInfo
Definition: recordingrule.h:165
kDupCheckSub
@ kDupCheckSub
Definition: recordingtypes.h:66
RecordingRule::ToMap
void ToMap(InfoMap &infoMap, uint date_format=0) const
Definition: recordingrule.cpp:544
MSqlQuery::lastInsertId
QVariant lastInsertId()
Return the id of the last inserted row.
Definition: mythdbcon.cpp:912
RecordingRule::m_title
QString m_title
Definition: recordingrule.h:75
RecordingRule::m_sortSubtitle
QString m_sortSubtitle
Definition: recordingrule.h:78
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:205
ProgramInfo::GetChannelSchedulingID
QString GetChannelSchedulingID(void) const
This is the unique programming identifier of a channel.
Definition: programinfo.h:383
ProgramInfo::GetCategory
QString GetCategory(void) const
Definition: programinfo.h:369
RecordingRule::m_averageDelay
int m_averageDelay
Definition: recordingrule.h:139
RecordingRule::m_lastDeleted
QDateTime m_lastDeleted
Definition: recordingrule.h:142
RecordingDupMethodType
RecordingDupMethodType
Definition: recordingtypes.h:62
RecordingRule::m_endOffset
int m_endOffset
Definition: recordingrule.h:108
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:608
RecordingRule::kNumFilters
static const int kNumFilters
Definition: recordingrule.h:33
ProgramInfo::GetScheduledEndTime
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
Definition: programinfo.h:397
playgroup.h
kKeywordSearch
@ kKeywordSearch
Definition: recordingtypes.h:83
mythsorthelper.h
RecordingRule::m_dupIn
RecordingDupInType m_dupIn
Definition: recordingrule.h:112
AutoExtendType
AutoExtendType
Definition: recordingtypes.h:93
RecordingRule::m_isInactive
bool m_isInactive
Recording rule is enabled?
Definition: recordingrule.h:72
RecordingRule::m_season
uint m_season
Definition: recordingrule.h:92
MythDate::kDateTimeShort
@ kDateTimeShort
Default local time.
Definition: mythdate.h:24
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:14
kDupsInAll
@ kDupsInAll
Definition: recordingtypes.h:50
RecordingRule::m_findid
int m_findid
Definition: recordingrule.h:100
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
RecordingRule::Load
bool Load(bool asTemplate=false)
Load a single rule from the recorded table.
Definition: recordingrule.cpp:56
ProgramInfo::GetInetRef
QString GetInetRef(void) const
Definition: programinfo.h:437
RecordingRule::m_startOffset
int m_startOffset
Definition: recordingrule.h:107
RecordingDupInType
RecordingDupInType
Definition: recordingtypes.h:45
RecordingRule::GetTemplateNames
static QStringList GetTemplateNames(void)
Definition: recordingrule.cpp:825
RecordingRule::m_isTemplate
bool m_isTemplate
Definition: recordingrule.h:154
RecordingRule::m_episode
uint m_episode
Definition: recordingrule.h:93
mythdate.h
RecordingRule::RecordingRule
RecordingRule()
Definition: recordingrule.cpp:27
ProgramInfo::GetScheduledStartTime
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
Definition: programinfo.h:390
RecordingRule::IsValid
bool IsValid(QString &msg) const
Definition: recordingrule.cpp:849
AutoExtendType::Last
@ Last
MythCoreContext::GetQLocale
QLocale GetQLocale(void)
Definition: mythcorecontext.cpp:1863
RecordingRule::m_autoUserJob4
bool m_autoUserJob4
Definition: recordingrule.h:134
kPowerSearch
@ kPowerSearch
Definition: recordingtypes.h:81
kTemplateRecord
@ kTemplateRecord
Definition: recordingtypes.h:33
RecordingInfo::GetRecgroupString
static QString GetRecgroupString(uint recGroupID)
Temporary helper during transition from string to ID.
Definition: recordinginfo.cpp:1707
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:361
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:540
ProgramInfo::GetDescription
QString GetDescription(void) const
Definition: programinfo.h:365
RecordingRule::m_autoUserJob2
bool m_autoUserJob2
Definition: recordingrule.h:132
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:227
RecordingRule::AssignProgramInfo
void AssignProgramInfo()
Definition: recordingrule.cpp:727
RecordingRule::m_findtime
QTime m_findtime
Time for timeslot rules.
Definition: recordingrule.h:99
RecordingRule::m_lastRecorded
QDateTime m_lastRecorded
Definition: recordingrule.h:141
RecordingRule::m_autoExpire
bool m_autoExpire
Definition: recordingrule.h:124
RecordingRule::m_recProfile
QString m_recProfile
Definition: recordingrule.h:118
RecordingRule::m_tempID
int m_tempID
Definition: recordingrule.h:146
RecordingRule::m_searchType
RecSearchType m_searchType
Definition: recordingrule.h:110
RecordingRule::m_type
RecordingType m_type
Definition: recordingrule.h:109
RecSearchType
RecSearchType
Definition: recordingtypes.h:78
RecordingRule::m_subtitle
QString m_subtitle
Definition: recordingrule.h:77
RecordingRule::UseTempTable
void UseTempTable(bool usetemp, const QString &table="record_tmp")
Definition: recordingrule.cpp:667
MSqlQuery::SchedCon
static MSqlQueryInfo SchedCon()
Returns dedicated connection. (Required for using temporary SQL tables.)
Definition: mythdbcon.cpp:570
scheduledrecording.h
RecordingRule::m_findday
int m_findday
Day of the week for once per week etc.
Definition: recordingrule.h:102
kNoSearch
@ kNoSearch
Definition: recordingtypes.h:80
RecordingRule::m_filter
unsigned m_filter
Definition: recordingrule.h:113
ProgramInfo::GetFindID
uint GetFindID(void) const
Definition: programinfo.h:468
kManualSearch
@ kManualSearch
Definition: recordingtypes.h:85
uint
unsigned int uint
Definition: compat.h:79
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
ProgramInfo::GetSeriesID
QString GetSeriesID(void) const
Definition: programinfo.h:435
RecordingRule::MakeTemplate
bool MakeTemplate(QString category)
Definition: recordingrule.cpp:311
RecordingRule::m_maxEpisodes
int m_maxEpisodes
Definition: recordingrule.h:123
ProgramInfo::GetSortSubtitle
QString GetSortSubtitle(void) const
Definition: programinfo.h:364
kTitleSearch
@ kTitleSearch
Definition: recordingtypes.h:82
RecordingRule::m_programid
QString m_programid
Definition: recordingrule.h:83
kOneRecord
@ kOneRecord
Definition: recordingtypes.h:28
RecordingRule::m_sortTitle
QString m_sortTitle
Definition: recordingrule.h:76
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:34
RecordingRule::m_recGroupID
uint m_recGroupID
Definition: recordingrule.h:121
RecordingRule::m_endtime
QTime m_endtime
Definition: recordingrule.h:90
MythDate::kSimplify
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
Definition: mythdate.h:26
kWeeklyRecord
@ kWeeklyRecord
Definition: recordingtypes.h:27
RecordingRule::m_storageGroup
QString m_storageGroup
Definition: recordingrule.h:119
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:372
ProgramInfo::GetEpisode
uint GetEpisode(void) const
Definition: programinfo.h:367
RecordingRule::m_transcoder
int m_transcoder
Definition: recordingrule.h:128
RecordingRule::m_autoUserJob1
bool m_autoUserJob1
Definition: recordingrule.h:131
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
RecordingRule::m_recordID
int m_recordID
Unique Recording Rule ID.
Definition: recordingrule.h:68
MythDate::kAddYear
@ kAddYear
Add year to string if not included.
Definition: mythdate.h:25
ProgramInfo::GetSeason
uint GetSeason(void) const
Definition: programinfo.h:366
mythcorecontext.h
kOverrideRecord
@ kOverrideRecord
Definition: recordingtypes.h:29
RecordingRule::m_dupMethod
RecordingDupMethodType m_dupMethod
Definition: recordingrule.h:111
MythDate
Definition: mythdate.cpp:11
ProgramInfo::GetCategoryTypeString
QString GetCategoryTypeString(void) const
Returns catType as a string.
Definition: programinfo.cpp:1887
RecordingRule::ensureSortFields
void ensureSortFields(void)
Ensure that the sortTitle and sortSubtitle fields are set.
Definition: recordingrule.cpp:43
kNotRecording
@ kNotRecording
Definition: recordingtypes.h:22
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:883
kDupCheckNone
@ kDupCheckNone
Definition: recordingtypes.h:65
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:17
kSingleRecord
@ kSingleRecord
Definition: recordingtypes.h:23
RecordingRule::m_autoExtend
AutoExtendType m_autoExtend
Definition: recordingrule.h:114
RecordingRule::m_loaded
bool m_loaded
Definition: recordingrule.h:169
RecordingRule::Delete
bool Delete(bool sendSig=true)
Definition: recordingrule.cpp:501
MythDate::kDateFull
@ kDateFull
Default local time.
Definition: mythdate.h:19
RecordingRule::MakeOverride
bool MakeOverride(void)
Definition: recordingrule.cpp:360
kAllRecord
@ kAllRecord
Definition: recordingtypes.h:26
recordingprofile.h
ProgramInfo::GetProgramID
QString GetProgramID(void) const
Definition: programinfo.h:436
RecordingProfile
Definition: recordingprofile.h:41
MythDate::kDateTimeFull
@ kDateTimeFull
Default local time.
Definition: mythdate.h:23
kDupsNewEpi
@ kDupsNewEpi
Definition: recordingtypes.h:51
RecordingRule::m_station
QString m_station
Definition: recordingrule.h:96
MythDate::kTime
@ kTime
Default local time.
Definition: mythdate.h:22
ProgramInfo::GetRecordingRuleID
uint GetRecordingRuleID(void) const
Definition: programinfo.h:449
recordingrule.h
RecordingRule::m_recPriority
int m_recPriority
Definition: recordingrule.h:105
RecordingRule::m_autoUserJob3
bool m_autoUserJob3
Definition: recordingrule.h:133
ScheduledRecording::RescheduleMatch
static void RescheduleMatch(uint recordid, uint sourceid, uint mplexid, const QDateTime &maxstarttime, const QString &why)
Definition: scheduledrecording.h:17
RecordingRule::LoadBySearch
bool LoadBySearch(RecSearchType lsearch, const QString &textname, const QString &forwhat, QString joininfo="", ProgramInfo *pginfo=nullptr)
Load a recording rule based on search parameters.
Definition: recordingrule.cpp:213
RecordingType
RecordingType
Definition: recordingtypes.h:20
kPeopleSearch
@ kPeopleSearch
Definition: recordingtypes.h:84
kDontRecord
@ kDontRecord
Definition: recordingtypes.h:30
RecordingRule::m_startdate
QDate m_startdate
Definition: recordingrule.h:87
RecordingRule::m_autoMetadataLookup
bool m_autoMetadataLookup
Definition: recordingrule.h:135
null_to_empty
static QString null_to_empty(const QString &str)
Definition: recordingrule.cpp:17
RecordingRule::m_prefInput
int m_prefInput
Definition: recordingrule.h:106
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:832
RecordingRule::SearchTypeToString
static QString SearchTypeToString(RecSearchType searchType)
Definition: recordingrule.cpp:796
ProgramInfo::GetSubtitle
QString GetSubtitle(void) const
Definition: programinfo.h:363