19 #define LOC QString("ProgramData: ")
21 static const std::array<const std::string,DBPerson::kGuest+1>
roles
24 "actor",
"director",
"producer",
"executive_producer",
25 "writer",
"guest_star",
"host",
"adapter",
26 "presenter",
"commentator",
"guest",
31 return str.isNull() ?
"" : str;
36 return dt.isNull() ? QVariant(
"0000-00-00 00:00:00") : QVariant(dt);
40 uint chanid,
const QDateTime &starttime)
42 QString relevance = QString(
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
43 for (
auto it = genres.constBegin(); (it != genres.constEnd()) &&
44 ((it - genres.constBegin()) < relevance.size()); ++it)
47 "INSERT INTO programgenres "
48 " ( chanid, starttime, genre, relevance) "
49 "VALUES (:CHANID, :START, :genre, :relevance)");
53 query.
bindValue(
":relevance", relevance.at(it - genres.constBegin()));
61 : m_role(other.m_role)
62 , m_name(other.m_name)
63 , m_priority(other.m_priority)
64 , m_character(other.m_character)
86 , m_name(std::move(name))
87 , m_priority(priority)
88 , m_character(std::move(character))
95 int priority, QString character)
97 , m_name(std::move(name))
98 , m_priority(priority)
99 , m_character(std::move(character))
103 std::string rolestr = role.toLower().toStdString();
104 for (
size_t i = 0; i <
roles.size(); ++i)
106 if (rolestr ==
roles[i])
127 const QDateTime &starttime,
128 bool recording)
const
143 starttime, recording);
151 "WHERE name = :NAME");
156 else if (query.
next())
157 return query.
value(0).toUInt();
165 "INSERT IGNORE INTO people (name) "
181 "WHERE name = :NAME");
185 return query.
value(0).toUInt();
193 "INSERT IGNORE INTO roles (name) "
205 uint chanid,
const QDateTime &starttime,
206 bool recording)
const
211 QString table = recording ?
"recordedcredits" :
"credits";
213 query.
prepare(QString(
"REPLACE INTO %1 "
214 " ( person, roleid, chanid, starttime, role, priority) "
215 "VALUES (:PERSON, :ROLEID, :CHANID, :STARTTIME, :ROLE, :PRIORITY);")
220 query.
bindValue(
":STARTTIME", starttime);
299 int priority,
const QString &character)
304 m_credits->emplace_back(role, name.simplified(),
305 priority, character.simplified());
309 int priority,
const QString &character)
314 m_credits->emplace_back(role, name.simplified(),
315 priority, character.simplified());
329 LOG(VB_EIT, LOG_DEBUG,
330 QString(
"EIT: new program: %1 %2 '%3' chanid %4")
334 QString::number(chanid)));
337 QDateTime now = QDateTime::currentDateTimeUtc();
340 LOG(VB_EIT, LOG_DEBUG,
341 QString(
"EIT: skip '%1' endtime is in the past")
348 std::vector<DBEvent> programs;
359 for (
uint j=0; j<count; ++j)
361 LOG(VB_EIT, LOG_DEBUG,
362 QString(
"EIT: overlap[%1] : %2 %3 '%4'")
363 .arg(QString::number(j),
366 programs[j].m_title.left(35)));
376 if (match >= match_threshold)
381 LOG(VB_EIT, LOG_DEBUG,
382 QString(
"EIT: accept match[%1]: %2 '%3' vs. '%4'")
385 programs[i].m_title.left(35)));
386 return UpdateDB(query, chanid, programs, i);
394 LOG(VB_EIT, LOG_DEBUG,
395 QString(
"EIT: reject match[%1]: %2 '%3' vs. '%4'")
398 programs[i].m_title.left(35)));
403 return UpdateDB(query, chanid, programs, -1);
430 MSqlQuery &query,
uint chanid, std::vector<DBEvent> &programs)
const
434 "SELECT title, subtitle, description, "
435 " category, category_type, "
436 " starttime, endtime, "
437 " subtitletypes+0,audioprop+0, videoprop+0, "
438 " seriesid, programid, "
439 " partnumber, parttotal, "
440 " syndicatedepisodenumber, "
441 " airdate, originalairdate, "
442 " previouslyshown,listingsource, "
444 " season, episode, totalepisodes, "
447 "WHERE chanid = :CHANID AND "
449 " ( ( starttime >= :STIME1 AND starttime < :ETIME1 ) OR "
450 " ( endtime > :STIME2 AND endtime <= :ETIME2 ) OR "
451 " ( starttime < :STIME3 AND endtime > :ETIME3 ) )");
472 query.
value(0).toString(),
473 query.
value(1).toString(),
474 query.
value(2).toString(),
475 query.
value(3).toString(),
479 query.
value(7).toUInt(),
480 query.
value(8).toUInt(),
481 query.
value(9).toUInt(),
482 query.
value(19).toDouble(),
483 query.
value(10).toString(),
484 query.
value(11).toString(),
485 query.
value(18).toUInt(),
486 query.
value(20).toUInt(),
487 query.
value(21).toUInt(),
488 query.
value(22).toUInt());
498 programs.push_back(prog);
506 static int score_words(
const QStringList &al,
const QStringList &bl)
508 QStringList::const_iterator ait = al.begin();
509 QStringList::const_iterator bit = bl.begin();
511 for (; (ait != al.end()) && (bit != bl.end()); ++ait)
513 QStringList::const_iterator bit2 = bit;
516 for (; bit2 != bl.end(); ++bit2)
520 bscore = std::max(1000, 2000 - (dist * 500));
522 if (ait->length() < 5)
523 bscore /= 5 - ait->length();
528 if (bscore && dist < 3)
530 for (
int i = 0; (i < dist) && bit != bl.end(); ++i)
536 return score / al.size();
541 if (a.isEmpty() || b.isEmpty())
546 QString A = a.simplified().toUpper();
547 QString B = b.simplified().toUpper();
551 QStringList al = A.split(
" ", Qt::SkipEmptyParts);
555 QStringList bl = B.split(
" ", Qt::SkipEmptyParts);
562 return std::min(900, score);
568 int match_val = INT_MIN;
571 for (
size_t i = 0; i < programs.size(); ++i)
574 int duration_loop = programs[i].m_starttime.secsTo(programs[i].
m_endtime);
576 mv -= qAbs(
m_starttime.secsTo(programs[i].m_starttime));
577 mv -= qAbs(
m_endtime.secsTo(programs[i].m_endtime));
578 mv -= qAbs(duration - duration_loop);
587 overlap = programs[i].m_starttime.secsTo(
m_endtime);
606 int min_dur = std::max(2, std::min(duration, duration_loop));
607 overlap = std::min(overlap, min_dur/2);
613 LOG(VB_GENERAL, LOG_ERR,
614 QString(
"Unexpected result: shows don't "
615 "overlap\n\t%1: %2 - %3\n\t%4: %5 - %6")
619 .arg(programs[i].m_title.left(35), 35)
620 .arg(programs[i].m_starttime.toString(
Qt::ISODate),
627 LOG(VB_EIT, LOG_DEBUG,
628 QString(
"GM : '%1' new best match '%2' with score %3")
630 programs[i].m_title.left(35),
631 QString::number(mv)));
641 MSqlQuery &q,
uint chanid,
const std::vector<DBEvent> &
p,
int match)
const
645 for (
size_t i = 0; i <
p.size(); ++i)
647 if (i != (
uint)match)
654 LOG(VB_EIT, LOG_DEBUG,
655 QString(
"EIT: cannot insert '%1' MoveOutOfTheWayDB failed")
661 if ((match < 0) || ((
uint)match >=
p.size()))
663 LOG(VB_EIT, LOG_DEBUG,
664 QString(
"EIT: insert '%1'")
675 QDateTime now = QDateTime::currentDateTimeUtc();
678 LOG(VB_EIT, LOG_DEBUG,
679 QString(
"EIT: skip '%1' starttime is in the past")
686 LOG(VB_EIT, LOG_DEBUG,
687 QString(
"EIT: update '%1' with '%2'")
701 const QDateTime &old_starttime,
702 const QDateTime &new_starttime)
705 "SET starttime = :NEWSTARTTIME, "
706 " startdate = :NEWSTARTDATE "
707 "WHERE chanid = :CHANID "
709 "AND search = :SEARCH "
710 "AND starttime = :OLDSTARTTIME "
711 "AND startdate = :OLDSTARTDATE ");
715 query.
bindValue(
":OLDSTARTTIME", old_starttime.time());
716 query.
bindValue(
":OLDSTARTDATE", old_starttime.date());
717 query.
bindValue(
":NEWSTARTTIME", new_starttime.time());
718 query.
bindValue(
":NEWSTARTDATE", new_starttime.date());
731 LOG(VB_EIT, LOG_DEBUG,
732 QString(
"EIT: Updated record: chanid:%1 old:%3 new:%4 rows:%5")
733 .arg(QString::number(chanid),
736 QString::number(rows)));
760 QDateTime
const &old_starttime = match.
m_starttime;
764 LOG(VB_EIT, LOG_DEBUG,
765 QString(
"EIT: (U) change starttime from %1 to %2 for chanid:%3 program '%4' ")
768 QString::number(chanid),
772 if (ltitle.isEmpty() && !match.
m_title.isEmpty())
775 if (lsubtitle.isEmpty() && !match.
m_subtitle.isEmpty())
781 if (lcategory.isEmpty() && !match.
m_category.isEmpty())
790 if (lprogramId.isEmpty() && !match.
m_programId.isEmpty())
793 if (lseriesId.isEmpty() && !match.
m_seriesId.isEmpty())
796 if (linetref.isEmpty() && !match.
m_inetref.isEmpty())
834 if (lsyndicatedepisodenumber.isEmpty() &&
840 "SET title = :TITLE, subtitle = :SUBTITLE, "
841 " description = :DESC, "
842 " category = :CATEGORY, category_type = :CATTYPE, "
843 " starttime = :STARTTIME, endtime = :ENDTIME, "
844 " closecaptioned = :CC, subtitled = :HASSUBTITLES, "
845 " stereo = :STEREO, hdtv = :HDTV, "
846 " subtitletypes = :SUBTYPE, "
847 " audioprop = :AUDIOPROP, videoprop = :VIDEOPROP, "
848 " season = :SEASON, "
849 " episode = :EPISODE, totalepisodes = :TOTALEPS, "
850 " partnumber = :PARTNO, parttotal = :PARTTOTAL, "
851 " syndicatedepisodenumber = :SYNDICATENO, "
852 " airdate = :AIRDATE, originalairdate=:ORIGAIRDATE, "
853 " listingsource = :LSOURCE, "
854 " seriesid = :SERIESID, programid = :PROGRAMID, "
855 " previouslyshown = :PREVSHOWN, inetref = :INETREF "
856 "WHERE chanid = :CHANID AND "
857 " starttime = :OLDSTART ");
868 query.
bindValue(
":CC", (lsubtype & SUB_HARDHEAR) != 0);
869 query.
bindValue(
":HASSUBTITLES",(lsubtype & SUB_NORMAL) != 0);
870 query.
bindValue(
":STEREO", (laudio & AUD_STEREO) != 0);
871 query.
bindValue(
":HDTV", (lvideo & VID_HDTV) != 0);
877 query.
bindValue(
":TOTALEPS", lepisodeTotal);
879 query.
bindValue(
":PARTTOTAL", lparttotal);
881 query.
bindValue(
":AIRDATE", lairdate ? QString::number(lairdate) :
"0000");
882 query.
bindValue(
":ORIGAIRDATE", loriginalairdate);
883 query.
bindValue(
":LSOURCE", llistingsource);
886 query.
bindValue(
":PREVSHOWN", lpreviouslyshown);
904 "INSERT IGNORE INTO programrating "
905 " ( chanid, starttime, `system`, rating) "
906 "VALUES (:CHANID, :START, :SYS, :RATING)");
924 "DELETE from program "
925 "WHERE chanid = :CHANID AND "
926 " starttime = :STARTTIME");
938 "DELETE from credits "
939 "WHERE chanid = :CHANID AND "
940 " starttime = :STARTTIME");
952 "DELETE from programrating "
953 "WHERE chanid = :CHANID AND "
954 " starttime = :STARTTIME");
966 "DELETE from programgenres "
967 "WHERE chanid = :CHANID AND "
968 " starttime = :STARTTIME");
985 "SELECT title FROM program "
986 "WHERE chanid = :CHANID AND "
987 " starttime = :OLDSTART");
998 const QDateTime &new_st,
const QDateTime &new_end)
1002 "SET starttime = :NEWSTART, "
1003 " endtime = :NEWEND "
1004 "WHERE chanid = :CHANID AND "
1005 " starttime = :OLDSTART");
1020 "SET starttime = :NEWSTART "
1021 "WHERE chanid = :CHANID AND "
1022 " starttime = :OLDSTART");
1035 "UPDATE programrating "
1036 "SET starttime = :NEWSTART "
1037 "WHERE chanid = :CHANID AND "
1038 " starttime = :OLDSTART");
1051 "UPDATE programgenres "
1052 "SET starttime = :NEWSTART "
1053 "WHERE chanid = :CHANID AND "
1054 " starttime = :OLDSTART");
1078 LOG(VB_EIT, LOG_DEBUG,
1079 QString(
"EIT: delete '%1' %2 - %3")
1092 LOG(VB_EIT, LOG_DEBUG,
1093 QString(
"EIT: change '%1' endtime to %2")
1110 LOG(VB_EIT, LOG_DEBUG,
1111 QString(
"EIT: delete '%1' %2 - %3")
1117 LOG(VB_EIT, LOG_DEBUG,
1118 QString(
"EIT: (M) change starttime from %1 to %2 for chanid:%3 program '%4' ")
1121 QString::number(chanid),
1138 bool recording)
const
1140 QString table = recording ?
"recordedprogram" :
"program";
1144 " chanid, title, subtitle, description, "
1145 " category, category_type, "
1146 " starttime, endtime, "
1147 " closecaptioned, stereo, hdtv, subtitled, "
1148 " subtitletypes, audioprop, videoprop, "
1149 " stars, partnumber, parttotal, "
1150 " syndicatedepisodenumber, "
1151 " airdate, originalairdate,listingsource, "
1152 " seriesid, programid, previouslyshown, "
1153 " season, episode, totalepisodes, "
1156 " :CHANID, :TITLE, :SUBTITLE, :DESCRIPTION, "
1157 " :CATEGORY, :CATTYPE, "
1158 " :STARTTIME, :ENDTIME, "
1159 " :CC, :STEREO, :HDTV, :HASSUBTITLES, "
1160 " :SUBTYPES, :AUDIOPROP, :VIDEOPROP, "
1161 " :STARS, :PARTNUMBER, :PARTTOTAL, "
1163 " :AIRDATE, :ORIGAIRDATE, :LSOURCE, "
1164 " :SERIESID, :PROGRAMID, :PREVSHOWN, "
1165 " :SEASON, :EPISODE, :TOTALEPISODES, "
1166 " :INETREF ) ").arg(table));
1205 table = recording ?
"recordedrating" :
"programrating";
1209 "INSERT IGNORE INTO %1 "
1210 " ( chanid, starttime, `system`, rating) "
1211 "VALUES (:CHANID, :START, :SYS, :RATING)").arg(table));
1224 credit.InsertDB(query, chanid,
m_starttime, recording);
1233 DBEvent(other.m_listingsource)
1293 bool recording)
const
1295 QString table = recording ?
"recordedprogram" :
"program";
1297 LOG(VB_XMLTV, LOG_DEBUG,
1298 QString(
"Inserting new %1 : %2 - %3 %4 %5")
1306 " chanid, title, subtitle, description, "
1307 " category, category_type, "
1308 " starttime, endtime, "
1309 " closecaptioned, stereo, hdtv, subtitled, "
1310 " subtitletypes, audioprop, videoprop, "
1311 " partnumber, parttotal, "
1312 " syndicatedepisodenumber, "
1313 " airdate, originalairdate,listingsource, "
1314 " seriesid, programid, previouslyshown, "
1315 " stars, showtype, title_pronounce, colorcode, "
1316 " season, episode, totalepisodes, "
1319 " :CHANID, :TITLE, :SUBTITLE, :DESCRIPTION, "
1320 " :CATEGORY, :CATTYPE, "
1321 " :STARTTIME, :ENDTIME, "
1322 " :CC, :STEREO, :HDTV, :HASSUBTITLES, "
1323 " :SUBTYPES, :AUDIOPROP, :VIDEOPROP, "
1324 " :PARTNUMBER, :PARTTOTAL, "
1326 " :AIRDATE, :ORIGAIRDATE, :LSOURCE, "
1327 " :SERIESID, :PROGRAMID, :PREVSHOWN, "
1328 " :STARS, :SHOWTYPE, :TITLEPRON, :COLORCODE, "
1329 " :SEASON, :EPISODE, :TOTALEPISODES, "
1330 " :INETREF )").arg(table));
1377 table = recording ?
"recordedrating" :
"programrating";
1380 query.
prepare(QString(
"INSERT IGNORE INTO %1 "
1381 " ( chanid, starttime, `system`, rating) "
1382 "VALUES (:CHANID, :START, :SYS, :RATING)")
1396 credit.InsertDB(query, chanid,
m_starttime, recording);
1405 uint chanid,
const QDateTime &from,
const QDateTime &to,
1406 bool use_channel_time_offset)
1408 std::chrono::seconds secs = 0s;
1409 if (use_channel_time_offset)
1412 QDateTime newFrom = from.addSecs(secs.count());
1413 QDateTime newTo = to.addSecs(secs.count());
1416 query.
prepare(
"DELETE FROM program "
1417 "WHERE starttime >= :FROM AND starttime < :TO "
1418 "AND chanid = :CHANID ;");
1422 bool ok = query.
exec();
1424 query.
prepare(
"DELETE FROM programrating "
1425 "WHERE starttime >= :FROM AND starttime < :TO "
1426 "AND chanid = :CHANID ;");
1432 query.
prepare(
"DELETE FROM credits "
1433 "WHERE starttime >= :FROM AND starttime < :TO "
1434 "AND chanid = :CHANID ;");
1440 query.
prepare(
"DELETE FROM programgenres "
1441 "WHERE starttime >= :FROM AND starttime < :TO "
1442 "AND chanid = :CHANID ;");
1452 uint sourceid,
const QDateTime &from,
const QDateTime &to,
1453 bool use_channel_time_offset)
1458 auto cleardata = [&](
uint chanid)
1460 std::for_each(chanids.cbegin(), chanids.cend(), cleardata);
1473 QList<ProgInfo*>::iterator it = fixlist.begin();
1476 QList<ProgInfo*>::iterator cur = it;
1480 if ((*cur)->m_endts.isEmpty() || (*cur)->m_startts > (*cur)->m_endts)
1482 if (it != fixlist.end())
1484 (*cur)->m_endts = (*it)->m_startts;
1485 (*cur)->m_endtime = (*it)->m_starttime;
1492 if (it == fixlist.end())
1496 if ((*cur)->HasTimeConflict(**it))
1498 QList<ProgInfo*>::iterator tokeep;
1499 QList<ProgInfo*>::iterator todelete;
1501 if ((*cur)->m_endtime <= (*cur)->m_starttime)
1502 tokeep = it, todelete = cur;
1503 else if ((*it)->m_endtime <= (*it)->m_starttime)
1504 tokeep = cur, todelete = it;
1505 else if (!(*cur)->m_subtitle.isEmpty() &&
1506 (*it)->m_subtitle.isEmpty())
1507 tokeep = cur, todelete = it;
1508 else if (!(*it)->m_subtitle.isEmpty() &&
1509 (*cur)->m_subtitle.isEmpty())
1510 tokeep = it, todelete = cur;
1511 else if (!(*cur)->m_description.isEmpty() &&
1512 (*it)->m_description.isEmpty())
1513 tokeep = cur, todelete = it;
1515 tokeep = it, todelete = cur;
1518 LOG(VB_XMLTV, LOG_DEBUG,
1519 QString(
"Removing conflicting program: %1 - %2 %3 %4")
1520 .arg((*todelete)->m_starttime.toString(
Qt::ISODate),
1522 (*todelete)->m_channel,
1523 (*todelete)->m_title));
1525 LOG(VB_XMLTV, LOG_DEBUG,
1526 QString(
"Conflicted with : %1 - %2 %3 %4")
1527 .arg((*tokeep)->m_starttime.toString(
Qt::ISODate),
1529 (*tokeep)->m_channel,
1530 (*tokeep)->m_title));
1532 bool step_back = todelete == it;
1533 it = fixlist.erase(todelete);
1549 uint sourceid, QMap<QString, QList<ProgInfo> > &proglist)
1556 QMap<QString, QList<ProgInfo> >::const_iterator mapiter;
1557 for (mapiter = proglist.cbegin(); mapiter != proglist.cend(); ++mapiter)
1559 if (mapiter.key().isEmpty())
1565 "WHERE deleted IS NULL AND "
1566 " sourceid = :ID AND "
1567 " xmltvid = :XMLTVID");
1569 query.
bindValue(
":XMLTVID", mapiter.key());
1577 std::vector<uint> chanids;
1578 while (query.
next())
1579 chanids.push_back(query.
value(0).toUInt());
1581 if (chanids.empty())
1583 LOG(VB_GENERAL, LOG_NOTICE,
1584 QString(
"Unknown xmltv channel identifier: %1"
1585 " - Skipping channel.").arg(mapiter.key()));
1589 QList<ProgInfo> &list = proglist[mapiter.key()];
1590 QList<ProgInfo*> sortlist;
1592 for (
auto it = list.begin(); it != list.end(); ++it)
1593 sortlist.push_back(&(*it));
1597 for (
uint chanid : chanids)
1601 LOG(VB_GENERAL, LOG_INFO,
1602 QString(
"Updated programs: %1 Unchanged programs: %2")
1603 .arg(updated) .arg(unchanged));
1619 const QList<ProgInfo*> &sortlist,
1623 for (
auto *pinfo : std::as_const(sortlist))
1634 updated += pinfo->InsertDB(query, chanid);
1648 querystr =
"SELECT chanid, starttime, endtime FROM program "
1649 "WHERE endtime = '0000-00-00 00:00:00' "
1650 "ORDER BY chanid, starttime;";
1652 if (!query1.
exec(querystr))
1654 LOG(VB_GENERAL, LOG_ERR,
1655 QString(
"fix_end_times query failed: %1").arg(querystr));
1659 while (query1.
next())
1661 starttime = query1.
value(1).toString();
1662 chanid = query1.
value(0).toString();
1663 endtime = query1.
value(2).toString();
1665 querystr = QString(
"SELECT chanid, starttime, endtime FROM program "
1666 "WHERE starttime > '%1' "
1667 "AND chanid = '%2' "
1668 "ORDER BY starttime LIMIT 1;")
1669 .arg(starttime, chanid);
1671 if (!query2.
exec(querystr))
1673 LOG(VB_GENERAL, LOG_ERR,
1674 QString(
"fix_end_times query failed: %1").arg(querystr));
1678 if (query2.
next() && (endtime != query2.
value(1).toString()))
1681 endtime = query2.
value(1).toString();
1682 querystr = QString(
"UPDATE program SET "
1683 "endtime = '%2' WHERE (chanid = '%3' AND "
1684 "starttime = '%4');")
1685 .arg(endtime, chanid, starttime);
1687 if (!query2.
exec(querystr))
1689 LOG(VB_GENERAL, LOG_ERR,
1690 QString(
"fix_end_times query failed: %1").arg(querystr));
1705 "WHERE chanid = :CHANID AND "
1706 " starttime = :START AND "
1707 " endtime = :END AND "
1708 " title = :TITLE AND "
1709 " subtitle = :SUBTITLE AND "
1710 " description = :DESC AND "
1711 " category = :CATEGORY AND "
1712 " category_type = :CATEGORY_TYPE AND "
1713 " airdate = :AIRDATE AND "
1714 " stars >= (:STARS1 - 0.001) AND "
1715 " stars <= (:STARS2 + 0.001) AND "
1716 " previouslyshown = :PREVIOUSLYSHOWN AND "
1717 " title_pronounce = :TITLE_PRONOUNCE AND "
1718 " audioprop = :AUDIOPROP AND "
1719 " videoprop = :VIDEOPROP AND "
1720 " subtitletypes = :SUBTYPES AND "
1721 " partnumber = :PARTNUMBER AND "
1722 " parttotal = :PARTTOTAL AND "
1723 " seriesid = :SERIESID AND "
1724 " showtype = :SHOWTYPE AND "
1725 " colorcode = :COLORCODE AND "
1726 " syndicatedepisodenumber = :SYNDICATEDEPISODENUMBER AND "
1727 " programid = :PROGRAMID AND "
1728 " season = :SEASON AND "
1729 " episode = :EPISODE AND "
1730 " totalepisodes = :TOTALEPISODES AND "
1731 " inetref = :INETREF");
1742 query.
bindValue(
":CATEGORY_TYPE", cattype);
1756 query.
bindValue(
":SYNDICATEDEPISODENUMBER",
1765 return query.
value(0).toUInt() > 0;
1777 "SELECT title,starttime,endtime "
1779 "WHERE chanid = :CHANID AND "
1780 " starttime >= :START AND "
1781 " starttime < :END;");
1794 LOG(VB_XMLTV, LOG_DEBUG,
1795 QString(
"Removing existing program: %1 - %2 %3 %4")
1799 query.
value(0).toString()));
1800 }
while (query.
next());
1805 LOG(VB_XMLTV, LOG_ERR,
1806 QString(
"Program delete failed : %1 - %2 %3 %4")