Go to the documentation of this file.
22 #define LOC QString("RecordingInfo(%1): ").arg(GetBasename())
26 { R
"(^\s*AND\s*)", QRegularExpression::CaseInsensitiveOption };
30 return str.isEmpty() ?
"" : str;
38 const QString &_title,
39 const QString &_sortTitle,
40 const QString &_subtitle,
41 const QString &_sortSubtitle,
42 const QString &_description,
46 const QString &_syndicatedepisode,
47 const QString &_category,
50 const QString &_chanstr,
51 const QString &_chansign,
52 const QString &_channame,
54 const QString &_recgroup,
55 const QString &_playgroup,
57 const QString &_hostname,
58 const QString &_storagegroup,
64 const QString &_seriesid,
65 const QString &_programid,
66 const QString &_inetref,
71 const QDateTime &_startts,
72 const QDateTime &_endts,
73 const QDateTime &_recstartts,
74 const QDateTime &_recendts,
77 QDate _originalAirDate,
97 uint _videoproperties,
98 uint _audioproperties,
103 const QString &_inputname) :
105 _title, _sortTitle, _subtitle, _sortSubtitle,
106 _description, _season, _episode, _totalepisodes,
107 _category, _chanid, _chanstr, _chansign, _channame,
108 QString(), _recgroup, _playgroup,
109 _startts, _endts, _recstartts, _recendts,
110 _seriesid, _programid, _inetref, _inputname),
111 m_oldrecstatus(_oldrecstatus),
113 m_schedOrder(_schedorder),
115 m_sgroupId(_sgroupid),
116 m_desiredRecStartTs(_startts),
117 m_desiredRecEndTs(_endts)
168 const QString &_title,
169 const QString &_sortTitle,
170 const QString &_subtitle,
171 const QString &_sortSubtitle,
172 const QString &_description,
175 const QString &_category,
178 const QString &_chanstr,
179 const QString &_chansign,
180 const QString &_channame,
182 const QString &_recgroup,
183 const QString &_playgroup,
185 const QString &_seriesid,
186 const QString &_programid,
187 const QString &_inetref,
191 const QDateTime &_startts,
192 const QDateTime &_endts,
193 const QDateTime &_recstartts,
194 const QDateTime &_recendts,
207 _title, _sortTitle, _subtitle, _sortSubtitle,
208 _description, _season, _episode, 0,
209 _category, _chanid, _chanstr, _chansign, _channame,
210 QString(), _recgroup, _playgroup,
211 _startts, _endts, _recstartts, _recendts,
212 _seriesid, _programid, _inetref,
""),
213 m_desiredRecStartTs(_startts),
214 m_desiredRecEndTs(_endts)
242 uint _chanid,
const QDateTime &desiredts,
243 bool genUnknown, std::chrono::hours maxHours,
LoadStatus *status)
249 QString querystr =
"WHERE program.chanid = :CHANID AND "
250 " program.starttime < :STARTTS1 AND "
251 " program.endtime > :STARTTS2 ";
252 bindings[
":CHANID"] = QString::number(_chanid);
253 QDateTime query_startts = desiredts.addSecs(50 - desiredts.time().second());
254 bindings[
":STARTTS1"] = query_startts;
255 bindings[
":STARTTS2"] = query_startts;
260 if (!progList.
empty())
266 auto maxSecs = duration_cast<std::chrono::seconds>(maxHours);
285 query.
prepare(
"SELECT chanid, channum, callsign, name, "
286 "commmethod, outputfilters "
288 "WHERE chanid = :CHANID");
312 FL_CHANCOMMFREE : FL_NONE;
346 querystr =
"WHERE program.chanid = :CHANID AND "
347 " program.starttime > :STARTTS "
348 "GROUP BY program.starttime ORDER BY program.starttime ";
349 bindings[
":CHANID"] = QString::number(_chanid);
350 bindings[
":STARTTS"] = desiredts.addSecs(50 - desiredts.time().second());
352 const uint limit = 1;
354 LoadFromProgram(progList, querystr, bindings, schedList, 0, limit, count);
356 if (!progList.
empty())
373 bool ignore_non_serialized_data)
389 if (!ignore_non_serialized_data)
408 bool ignore_non_serialized_data)
544 LOG(VB_GENERAL, LOG_ERR,
545 "ProgInfo Error: ApplyRecordRecID(void) needs recordid");
549 query.
prepare(
"UPDATE recorded "
550 "SET recordid = :RECID "
551 "WHERE chanid = :CHANID AND starttime = :START");
597 query.
prepare(
"UPDATE recorded"
598 " SET stars = :STARS"
599 " WHERE chanid = :CHANID"
600 " AND starttime = :START ;");
601 query.
bindValue(
":STARS", newstarsvalue);
622 query.
prepare(
"UPDATE recorded"
623 " SET originalairdate = :ORIGINALAIRDATE"
624 " WHERE chanid = :CHANID"
625 " AND starttime = :START ;");
626 query.
bindValue(
":ORIGINALAIRDATE", originalairdate);
663 if (newrecgroupid == 0)
665 query.
prepare(
"INSERT INTO recgroups SET recgroup = :NAME, "
666 "displayname = :DISPLAYNAME");
668 query.
bindValue(
":DISPLAYNAME", newrecgroup);
673 if (newrecgroupid <= 0)
675 LOG(VB_GENERAL, LOG_ERR, QString(
"Could not create recording group (%1). "
676 "Does it already exist?").arg(newrecgroup));
681 LOG(VB_GENERAL, LOG_NOTICE,
682 QString(
"ApplyRecordRecGroupChange: %1 to %2 (%3)")
683 .arg(
m_recGroup, newrecgroup, QString::number(newrecgroupid)));
685 query.
prepare(
"UPDATE recorded"
686 " SET recgroup = :RECGROUP, "
687 " recgroupid = :RECGROUPID "
688 " WHERE recordedid = :RECORDEDID");
690 query.
bindValue(
":RECGROUPID", newrecgroupid);
707 if (newrecgroupid > 0)
711 query.
prepare(
"UPDATE recorded"
712 " SET recgroup = :RECGROUP, "
713 " recgroupid = :RECGROUPID "
714 " WHERE chanid = :CHANID"
715 " AND starttime = :START ;");
717 query.
bindValue(
":RECGROUPID", newrecgroupid);
730 LOG(VB_GENERAL, LOG_NOTICE,
731 QString(
"ApplyRecordRecGroupChange: %1 to %2 (%3)")
732 .arg(
m_recGroup, newrecgroup).arg(newrecgroupid));
744 query.
prepare(
"UPDATE recorded"
745 " SET playgroup = :PLAYGROUP"
746 " WHERE chanid = :CHANID"
747 " AND starttime = :START ;");
769 query.
prepare(
"UPDATE recorded"
770 " SET storagegroup = :STORAGEGROUP"
771 " WHERE chanid = :CHANID"
772 " AND starttime = :START ;");
793 const QString &newSubtitle,
const QString &newDescription)
796 QString sql =
"UPDATE recorded SET title = :TITLE, subtitle = :SUBTITLE ";
797 if (!newDescription.isNull())
798 sql +=
", description = :DESCRIPTION ";
799 sql +=
" WHERE chanid = :CHANID AND starttime = :START ;";
804 if (!newDescription.isNull())
805 query.
bindValue(
":DESCRIPTION", newDescription);
814 if (!newDescription.isNull())
828 query.
prepare(
"UPDATE recorded "
829 "SET transcoder = :PROFILEID "
830 "WHERE chanid = :CHANID "
831 "AND starttime = :START");
838 "in recorded table", query);
853 query.
prepare(
"UPDATE recorded "
854 "SET transcoder = 0 "
855 "WHERE chanid = :CHANID "
856 "AND starttime = :START");
862 "in recorded table", query);
867 pidquery.
prepare(
"SELECT r.id "
868 "FROM recordingprofiles r, profilegroups p "
869 "WHERE r.profilegroup = p.id "
870 "AND p.name = 'Transcoders' "
871 "AND r.name = :PROFILE ");
874 if (!pidquery.
exec())
877 "profile ID", query);
879 else if (pidquery.
next())
881 query.
prepare(
"UPDATE recorded "
882 "SET transcoder = :TRANSCODER "
883 "WHERE chanid = :CHANID "
884 "AND starttime = :START");
891 "in recorded table", query);
895 LOG(VB_GENERAL, LOG_ERR,
896 "ProgramInfo: unable to query transcoder profile ID");
943 uint chanid,
const QDateTime& recstartts)
947 LOG(VB_RECORD, LOG_WARNING,
948 QString(
"QueryRecordedIdFromKey: Invalid chanid %1").arg(chanid));
951 if (!recstartts.isValid())
953 LOG(VB_RECORD, LOG_WARNING,
954 QString(
"QueryRecordedIdFromKey: Invalid start ts %1")
955 .arg(recstartts.toString()));
961 "SELECT recordedid FROM recorded "
962 "WHERE chanid = :CHANID AND starttime = :RECSTARTTS");
964 query.
bindValue(
":RECSTARTTS", recstartts);
967 recordedid = query.
value(0).toUInt();
989 LOG(VB_FILE, LOG_INFO,
LOC + QString(
"StartedRecording: Recording to '%1'")
995 query.
prepare(
"DELETE FROM recordedseek WHERE chanid = :CHANID"
996 " AND starttime = :START;");
1003 query.
prepare(
"DELETE FROM recordedmarkup WHERE chanid = :CHANID"
1004 " AND starttime = :START;");
1011 query.
prepare(
"REPLACE INTO recordedcredits"
1012 " SELECT * FROM credits"
1013 " WHERE chanid = :CHANID AND starttime = :START;");
1019 query.
prepare(
"REPLACE INTO recordedprogram"
1020 " SELECT * from program"
1021 " WHERE chanid = :CHANID AND starttime = :START"
1022 " AND title = :TITLE;");
1029 query.
prepare(
"REPLACE INTO recordedrating"
1030 " SELECT * from programrating"
1031 " WHERE chanid = :CHANID AND starttime = :START;");
1045 if (!dirname.isEmpty())
1047 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
1048 QString(
"InsertRecording: m_pathname was '%1'. "
1049 "This is usually blank.").arg(dirname));
1066 LOG(VB_GENERAL, LOG_ERR,
"Failed to insert new recording.");
1077 LOG(VB_GENERAL, LOG_ERR,
"Could not insert program");
1094 if (!query.
exec(
"LOCK TABLES recorded WRITE"))
1103 " WHERE chanid = :CHANID AND "
1104 " starttime = :STARTS");
1113 else if (query.
next())
1115 LOG(VB_GENERAL, LOG_ERR,
1116 QString(
"RecordingInfo::InsertProgram(%1): ")
1117 .arg(pg->
toString()) +
"recording already exists...");
1126 if (!query.
exec(
"UNLOCK TABLES"))
1132 "INSERT INTO recorded "
1133 " (chanid, starttime, endtime, title, "
1134 " subtitle, description, season, episode, "
1135 " hostname, category, recgroup, autoexpire, "
1136 " recordid, seriesid, programid, inetref, "
1137 " stars, previouslyshown, originalairdate, "
1138 " findid, transcoder, playgroup, recpriority, "
1139 " basename, progstart, progend, profile, "
1140 " duplicate, storagegroup, inputname, recgroupid) "
1142 " (:CHANID, :STARTS, :ENDS, :TITLE, "
1143 " :SUBTITLE, :DESC, :SEASON, :EPISODE, "
1144 " :HOSTNAME, :CATEGORY, :RECGROUP, :AUTOEXP, "
1145 " :RECORDID, :SERIESID, :PROGRAMID, :INETREF, "
1146 " :STARS, :REPEAT, :ORIGAIRDATE, "
1147 " :FINDID, :TRANSCODER, :PLAYGROUP, :RECPRIORITY, "
1148 " :BASENAME, :PROGSTART, :PROGEND, :PROFILE, "
1149 " 0, :STORGROUP, :INPUTNAME, :RECGROUPID) "
1166 else if (pg->
m_year >= 1895)
1172 query.
bindValue(
":ORIGAIRDATE",
"0000-00-00");
1201 query.
bindValue(
":INPUTNAME", inputname);
1202 query.
bindValue(
":RECGROUPID", recgroupid);
1211 if (!query.
exec(
"UNLOCK TABLES"))
1221 query.
prepare(
"UPDATE channel SET last_record = NOW() "
1222 "WHERE chanid = :CHANID");
1227 query.
prepare(
"UPDATE record SET last_record = NOW() "
1228 "WHERE recordid = :RECORDID");
1235 query.
prepare(
"UPDATE record SET last_record = NOW() "
1236 "WHERE recordid = :PARENTID");
1272 query.
prepare(
"UPDATE recorded SET endtime = :ENDTIME, "
1273 " duplicate = :DUPLICATE "
1274 "WHERE chanid = :CHANID AND "
1275 " starttime = :STARTTIME ");
1279 query.
bindValue(
":DUPLICATE", !allowReRecord);
1290 qint64 endtime =
m_recEndTs.toSecsSinceEpoch();
1293 QString msg =
"Finished recording";
1294 QString msg_subtitle =
m_subtitle.isEmpty() ?
"" :
1296 QString details = QString(
"%1%2: channel %3")
1299 LOG(VB_GENERAL, LOG_INFO, QString(
"%1 %2").arg(msg, details));
1312 query.
prepare(
"UPDATE recorded SET endtime = :ENDTIME "
1313 "WHERE chanid = :CHANID AND "
1314 " starttime = :STARTTIME ");
1333 result.
prepare(
"UPDATE oldrecorded SET reactivate = 1 "
1334 "WHERE station = :STATION AND "
1335 " starttime = :STARTTIME AND "
1336 " title = :TITLE;");
1355 LOG(VB_SCHEDULE, LOG_INFO, QString(
"AddHistory: %1/%2, %3, %4, %5/%6")
1366 result.
prepare(
"REPLACE INTO oldrecorded (chanid,starttime,"
1367 "endtime,title,subtitle,description,season,episode,"
1368 "category,seriesid,programid,inetref,findid,recordid,"
1369 "station,rectype,recstatus,duplicate,reactivate,generic,"
1371 "VALUES(:CHANID,:START,:END,:TITLE,:SUBTITLE,:DESC,:SEASON,"
1372 ":EPISODE,:CATEGORY,:SERIESID,:PROGRAMID,:INETREF,"
1373 ":FINDID,:RECORDID,:STATION,:RECTYPE,:RECSTATUS,:DUPLICATE,"
1374 ":REACTIVATE,:GENERIC,:FUTURE);");
1402 result.
prepare(
"REPLACE INTO oldfind (recordid, findid) "
1403 "VALUES(:RECORDID,:FINDID);");
1426 result.
prepare(
"DELETE FROM oldrecorded WHERE title = :TITLE AND "
1427 "starttime = :START AND station = :STATION");
1437 result.
prepare(
"DELETE FROM oldfind WHERE "
1438 "recordid = :RECORDID AND findid = :FINDID");
1473 result.
prepare(
"UPDATE recorded SET duplicate = 0 "
1474 "WHERE chanid = :CHANID "
1475 "AND starttime = :STARTTIME "
1476 "AND title = :TITLE;");
1488 "UPDATE recorded SET duplicate = 0 "
1489 "WHERE duplicate = 1 AND "
1490 " title = :TITLE AND "
1492 " (:PROGRAMID1 <> '' AND "
1493 " :PROGRAMID2 = recorded.programid) "
1496 " (:PROGRAMID3 = '' OR recorded.programid = '' OR "
1497 " LEFT(:PROGRAMID4, LOCATE('/', :PROGRAMID5)) <> "
1498 " LEFT(recorded.programid, "
1499 " LOCATE('/', recorded.programid))) "
1501 " (((:DUPMETHOD1 & 0x02) = 0) OR (:SUBTITLE1 <> '' "
1502 " AND :SUBTITLE2 = recorded.subtitle)) "
1504 " (((:DUPMETHOD2 & 0x04) = 0) OR (:DESCRIPTION1 <> '' "
1505 " AND :DESCRIPTION2 = recorded.description)) "
1507 " (((:DUPMETHOD3 & 0x08) = 0) OR "
1508 " (:SUBTITLE3 <> '' AND "
1509 " (:SUBTITLE4 = recorded.subtitle OR "
1510 " (recorded.subtitle = '' AND "
1511 " :SUBTITLE5 = recorded.description))) OR "
1512 " (:SUBTITLE6 = '' AND :DESCRIPTION3 <> '' AND "
1513 " (:DESCRIPTION4 = recorded.subtitle OR "
1514 " (recorded.subtitle = '' AND "
1515 " :DESCRIPTION5 = recorded.description)))) "
1544 result.
prepare(
"UPDATE oldrecorded SET duplicate = 0 "
1545 "WHERE station = :STATION "
1546 "AND starttime = :STARTTIME "
1547 "AND title = :TITLE;");
1559 "UPDATE oldrecorded SET duplicate = 0 "
1560 "WHERE duplicate = 1 AND "
1561 " title = :TITLE AND "
1563 " (:PROGRAMID1 <> '' AND "
1564 " :PROGRAMID2 = oldrecorded.programid) "
1567 " (:PROGRAMID3 = '' OR oldrecorded.programid = '' OR "
1568 " LEFT(:PROGRAMID4, LOCATE('/', :PROGRAMID5)) <> "
1569 " LEFT(oldrecorded.programid, "
1570 " LOCATE('/', oldrecorded.programid))) "
1572 " (((:DUPMETHOD1 & 0x02) = 0) OR (:SUBTITLE1 <> '' "
1573 " AND :SUBTITLE2 = oldrecorded.subtitle)) "
1575 " (((:DUPMETHOD2 & 0x04) = 0) OR (:DESCRIPTION1 <> '' "
1576 " AND :DESCRIPTION2 = oldrecorded.description)) "
1578 " (((:DUPMETHOD3 & 0x08) = 0) OR "
1579 " (:SUBTITLE3 <> '' AND "
1580 " (:SUBTITLE4 = oldrecorded.subtitle OR "
1581 " (oldrecorded.subtitle = '' AND "
1582 " :SUBTITLE5 = oldrecorded.description))) OR "
1583 " (:SUBTITLE6 = '' AND :DESCRIPTION3 <> '' AND "
1584 " (:DESCRIPTION4 = oldrecorded.subtitle OR "
1585 " (oldrecorded.subtitle = '' AND "
1586 " :DESCRIPTION5 = oldrecorded.description)))) "
1615 result.
prepare(
"DELETE FROM oldrecorded "
1616 "WHERE recstatus = :NEVER AND duplicate = 0");
1625 result.
prepare(
"DELETE FROM oldfind WHERE "
1626 "recordid = :RECORDID AND findid = :FINDID");
1646 result.
prepare(
"UPDATE oldrecorded SET duplicate = 1 "
1647 "WHERE future = 0 AND duplicate = 0 "
1648 "AND title = :TITLE AND "
1649 "((programid = '' AND subtitle = :SUBTITLE"
1650 " AND description = :DESC) OR "
1651 " (programid <> '' AND programid = :PROGRAMID) OR "
1652 " (findid <> 0 AND findid = :FINDID))");
1671 str.replace(
"%RECID%", QString::number(
getRecordID()));
1672 str.replace(
"%PARENTID%", QString::number(
m_parentId));
1673 str.replace(
"%FINDID%", QString::number(
m_findId));
1674 str.replace(
"%RECSTATUS%", QString::number(
m_recStatus));
1675 str.replace(
"%RECTYPE%", QString::number(
m_recType));
1690 query.
prepare(
"SELECT recgroupid FROM recgroups WHERE recgroup = :RECGROUP");
1699 return query.
value(0).toUInt();
1709 query.
prepare(
"SELECT recgroup FROM recgroups WHERE recgroupid = :RECGROUPID");
1710 query.
bindValue(
":RECGROUPID", recGroupID);
1711 if (!query.
exec() || !query.
next())
1716 return query.
value(0).toString();
void ApplyRecordPlayGroupChange(const QString &newplaygroup)
Sets the recording group, both in this RecordingInfo and in the database.
static uint GetRecgroupID(const QString &recGroup)
Temporary helper during transition from string to ID.
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
bool isActive(void) const
bool LoadByProgram(const ProgramInfo *proginfo)
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
static bool InsertProgram(RecordingInfo *pg, const RecordingRule *rule)
virtual void SaveFilesize(uint64_t fsize)
Sets recording file size in database, and sets "filesize" field.
void ApplyStarsChange(float newstarsvalue)
Sets the stars value in the database.
static bool QueryRecordedIdForKey(int &recordedid, uint chanid, const QDateTime &recstartts)
void FinishedRecording(bool allowReRecord)
If not a premature stop, adds program to history of recorded programs.
static const QRegularExpression kReSearchTypeName
virtual uint64_t GetFilesize(void) const
void ApplyNeverRecord(void)
Set this program to never be recorded by inserting 'history' for it into the database with a status o...
RecStatus::Type m_oldrecstatus
void SetRecordingStatus(RecStatus::Type status)
QString GetHostname(void) const
QString GetInputName(void) const
bool Save(bool sendSig=true)
AudioPropsType m_audioProperties
QDateTime m_desiredRecEndTs
void ApplyRecordStateChange(RecordingType newstate, bool save=true)
Sets RecordingType of "record", creating "record" if it does not exist.
void ApplyRecordRecID(void)
Sets recordid to match RecordingRule recordid.
static QMutex s_staticDataLock
Holds information on a TV Program one might wish to record.
uint64_t GetFilesize(void) const override
void ForgetHistory(void)
Forget the recording of a program so it will be recorded again.
virtual void clone(const ProgramInfo &other, bool ignore_non_serialized_data=false)
Copies important fields from other ProgramInfo.
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
void SetFilesize(uint64_t fsize) override
QVariant lastInsertId()
Return the id of the last inserted row.
static QString null_to_empty(const QString &str)
void DeleteHistory(void)
Deletes recording history, creating "record" it if necessary.
SubtitlePropsType m_subtitleProperties
QVariant value(int i) const
RecordingType GetProgramRecordingStatus(void)
Returns the recording type for this RecordingInfo, creating "record" field if necessary.
static const QRegularExpression kReLeadingAnd
Internal representation of a recording rule, mirrors the record table.
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Holds information on a recording file and it's video and audio streams.
void SetScheduledStartTime(const QDateTime &dt)
bool IsReactivated(void) const
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
void UpdateRecordingEnd(void)
Update information in the recorded table when the end-time of a recording is changed.
static QString s_unknownTitle
int getRecordID(void)
Returns a record id, creating "record" it if necessary.
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
void SendAddedEvent(void) const
Sends event out that the ProgramInfo should be added to lists.
void ApplyTranscoderProfileChange(const QString &profile) const
Sets the transcoder profile for a recording.
bool IsRepeat(void) const
void ApplyStorageGroupChange(const QString &newstoragegroup)
Sets the storage group, both in this RecordingInfo and in the database.
QString GetProgramRecordingProfile(void) const
Returns recording profile name that will be, or was used, for this program, creating "record" field i...
void ApplyOriginalAirDateChange(QDate originalairdate)
void SetRecordingEndTime(const QDateTime &dt)
RecordingFile * GetRecordingFile() const
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
RecStatus::Type GetRecordingStatus(void) const
RecStatus::Type m_savedrecstatus
void SetScheduledEndTime(const QDateTime &dt)
QDateTime m_desiredRecStartTs
void SaveFilesize(uint64_t fsize) override
Sets recording file size in database, and sets "filesize" field.
static QString GetRecgroupString(uint recGroupID)
Temporary helper during transition from string to ID.
QString GetTitle(void) const
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
int GetAutoRunJobs(void) const
Returns a bitmap of which jobs are attached to this RecordingInfo.
void QuickRecord(void)
Create a kSingleRecord if not already scheduled.
void SaveTotalDuration(std::chrono::milliseconds duration)
Store the Total Duration at frame 0 in the recordedmarkup table.
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
void insert(uint recordedid, PIAction action, uint64_t filesize=0ULL)
static void RescheduleCheck(const RecordingInfo &recinfo, const QString &why)
void ReactivateRecording(void)
Asks the scheduler to restart this recording if possible.
void StartedRecording(const QString &ext)
Inserts this RecordingInfo into the database as an existing recording.
virtual void SetFilesize(uint64_t sz)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
static eu8 clamp(eu8 value, eu8 low, eu8 high)
static QStringList LoadFromScheduler(const QString &tmptable, int recordid)
QString GetStorageGroup(void) const
static void ReschedulePlace(const QString &why)
QString m_chanPlaybackFilters
void ApplyRecordRecPriorityChange(int newrecpriority)
Sets recording priority of "record", creating "record" if it does not exist.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
static ProgramInfoUpdater * s_updater
~RecordingInfo() override
Destructor deletes "record" if it exists.
void SubstituteMatches(QString &str) override
Replace MATCH% vars in the specified string.
virtual void clone(const RecordingInfo &other, bool ignore_non_serialized_data=false)
Copies important fields from other RecordingInfo.
Holds information on recordings and videos.
int m_recordID
Unique Recording Rule ID.
bool InsertRecording(const QString &ext, bool force_match=false)
class RecordingRule * m_record
QString m_syndicatedEpisode
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool LoadFromProgram(ProgramList &destination, const QString &where, const QString &groupBy, const QString &orderBy, const MSqlBindings &bindings, const ProgramList &schedList)
void clear(void) override
void AddHistory(bool resched=true, bool forcedup=false, bool future=false)
Adds recording history, creating "record" it if necessary.
virtual void SubstituteMatches(QString &str)
Subsitute MATCH% type variable names in the given string.
void ApplyTranscoderProfileChangeById(int id)
static const uint kUnknownProgramLength
uint32_t m_programFlags
ProgramFlag.
void SendUpdateEvent(void) const
Sends event out that the ProgramInfo should be reloaded.
void SetRecordingID(uint _recordedid) override
bool Delete(bool sendSig=true)
int numRowsAffected() const
QString GetHostName(void)
void ApplyRecordRecTitleChange(const QString &newTitle, const QString &newSubtitle, const QString &newDescription)
Sets the recording title, subtitle, and description both in this RecordingInfo and in the database.
RecordingFile * m_recordingFile
RecordingRule * GetRecordingRule(void)
Returns the "record" field, creating it if necessary.
void ApplyRecordRecGroupChange(const QString &newrecgroup)
Sets the recording group, both in this RecordingInfo and in the database.
float m_stars
Rating, range [0..1].
QString GetBasename(void) const
void SetReactivated(bool reactivate)
bool IsGeneric(void) const
QString CreateRecordBasename(const QString &ext) const
Returns a filename for a recording based on the recording channel and date.
VideoPropsType m_videoProperties
bool m_autoMetadataLookup
QString m_storageDeviceID
QString GetSetting(const QString &key, const QString &defaultval="")
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
void SetDupHistory(void)
Set the duplicate flag in oldrecorded.