23#define LOC QString("RecordingInfo(%1): ").arg(GetBasename())
27 { R
"(^\s*AND\s*)", QRegularExpression::CaseInsensitiveOption };
34 const QString &_title,
35 const QString &_sortTitle,
36 const QString &_subtitle,
37 const QString &_sortSubtitle,
38 const QString &_description,
42 const QString &_syndicatedepisode,
43 const QString &_category,
46 const QString &_chanstr,
47 const QString &_chansign,
48 const QString &_channame,
50 const QString &_recgroup,
51 const QString &_playgroup,
53 const QString &_hostname,
54 const QString &_storagegroup,
60 const QString &_seriesid,
61 const QString &_programid,
62 const QString &_inetref,
67 const QDateTime &_startts,
68 const QDateTime &_endts,
69 const QDateTime &_recstartts,
70 const QDateTime &_recendts,
73 QDate _originalAirDate,
93 uint _videoproperties,
94 uint _audioproperties,
99 const QString &_inputname) :
101 _title, _sortTitle, _subtitle, _sortSubtitle,
102 _description, _season, _episode, _totalepisodes,
103 _category, _chanid, _chanstr, _chansign, _channame,
104 QString(), _recgroup, _playgroup,
105 _startts, _endts, _recstartts, _recendts,
106 _seriesid, _programid, _inetref, _inputname),
107 m_oldrecstatus(_oldrecstatus),
109 m_schedOrder(_schedorder),
111 m_sgroupId(_sgroupid),
112 m_desiredRecStartTs(_startts),
113 m_desiredRecEndTs(_endts)
164 const QString &_title,
165 const QString &_sortTitle,
166 const QString &_subtitle,
167 const QString &_sortSubtitle,
168 const QString &_description,
171 const QString &_category,
174 const QString &_chanstr,
175 const QString &_chansign,
176 const QString &_channame,
178 const QString &_recgroup,
179 const QString &_playgroup,
181 const QString &_seriesid,
182 const QString &_programid,
183 const QString &_inetref,
187 const QDateTime &_startts,
188 const QDateTime &_endts,
189 const QDateTime &_recstartts,
190 const QDateTime &_recendts,
203 _title, _sortTitle, _subtitle, _sortSubtitle,
204 _description, _season, _episode, 0,
205 _category, _chanid, _chanstr, _chansign, _channame,
206 QString(), _recgroup, _playgroup,
207 _startts, _endts, _recstartts, _recendts,
208 _seriesid, _programid, _inetref,
""),
209 m_desiredRecStartTs(_startts),
210 m_desiredRecEndTs(_endts)
238 uint _chanid,
const QDateTime &desiredts,
239 bool genUnknown, std::chrono::hours maxHours,
LoadStatus *status)
245 QString querystr =
"WHERE program.chanid = :CHANID AND "
246 " program.starttime < :STARTTS1 AND "
247 " program.endtime > :STARTTS2 ";
248 bindings[
":CHANID"] = QString::number(_chanid);
249 QDateTime query_startts = desiredts.addSecs(50 - desiredts.time().second());
250 bindings[
":STARTTS1"] = query_startts;
251 bindings[
":STARTTS2"] = query_startts;
256 if (!progList.
empty())
262 auto maxSecs = duration_cast<std::chrono::seconds>(maxHours);
281 query.
prepare(
"SELECT chanid, channum, callsign, name, "
282 "commmethod, outputfilters "
284 "WHERE chanid = :CHANID");
308 FL_CHANCOMMFREE : FL_NONE;
326#if QT_VERSION < QT_VERSION_CHECK(6,5,0)
337 QTimeZone(QTimeZone::UTC));
350 querystr =
"WHERE program.chanid = :CHANID AND "
351 " program.starttime > :STARTTS "
352 "GROUP BY program.starttime ORDER BY program.starttime ";
353 bindings[
":CHANID"] = QString::number(_chanid);
354 bindings[
":STARTTS"] = desiredts.addSecs(50 - desiredts.time().second());
356 const uint limit = 1;
358 LoadFromProgram(progList, querystr, bindings, schedList, 0, limit, count);
360 if (!progList.
empty())
377 bool ignore_non_serialized_data)
393 if (!ignore_non_serialized_data)
412 bool ignore_non_serialized_data)
548 LOG(VB_GENERAL, LOG_ERR,
549 "ProgInfo Error: ApplyRecordRecID(void) needs recordid");
553 query.
prepare(
"UPDATE recorded "
554 "SET recordid = :RECID "
555 "WHERE chanid = :CHANID AND starttime = :START");
601 query.
prepare(
"UPDATE recorded"
602 " SET stars = :STARS"
603 " WHERE chanid = :CHANID"
604 " AND starttime = :START ;");
605 query.
bindValue(
":STARS", newstarsvalue);
626 query.
prepare(
"UPDATE recorded"
627 " SET originalairdate = :ORIGINALAIRDATE"
628 " WHERE chanid = :CHANID"
629 " AND starttime = :START ;");
630 query.
bindValue(
":ORIGINALAIRDATE", originalairdate);
667 if (newrecgroupid == 0)
669 query.
prepare(
"INSERT INTO recgroups SET recgroup = :NAME, "
670 "displayname = :DISPLAYNAME");
672 query.
bindValue(
":DISPLAYNAME", newrecgroup);
677 if (newrecgroupid <= 0)
679 LOG(VB_GENERAL, LOG_ERR, QString(
"Could not create recording group (%1). "
680 "Does it already exist?").arg(newrecgroup));
685 LOG(VB_GENERAL, LOG_NOTICE,
686 QString(
"ApplyRecordRecGroupChange: %1 to %2 (%3)")
687 .arg(
m_recGroup, newrecgroup, QString::number(newrecgroupid)));
689 query.
prepare(
"UPDATE recorded"
690 " SET recgroup = :RECGROUP, "
691 " recgroupid = :RECGROUPID "
692 " WHERE recordedid = :RECORDEDID");
694 query.
bindValue(
":RECGROUPID", newrecgroupid);
711 if (newrecgroupid > 0)
715 query.
prepare(
"UPDATE recorded"
716 " SET recgroup = :RECGROUP, "
717 " recgroupid = :RECGROUPID "
718 " WHERE chanid = :CHANID"
719 " AND starttime = :START ;");
721 query.
bindValue(
":RECGROUPID", newrecgroupid);
734 LOG(VB_GENERAL, LOG_NOTICE,
735 QString(
"ApplyRecordRecGroupChange: %1 to %2 (%3)")
736 .arg(
m_recGroup, newrecgroup).arg(newrecgroupid));
748 query.
prepare(
"UPDATE recorded"
749 " SET playgroup = :PLAYGROUP"
750 " WHERE chanid = :CHANID"
751 " AND starttime = :START ;");
773 query.
prepare(
"UPDATE recorded"
774 " SET storagegroup = :STORAGEGROUP"
775 " WHERE chanid = :CHANID"
776 " AND starttime = :START ;");
797 const QString &newSubtitle,
const QString &newDescription)
800 QString sql =
"UPDATE recorded SET title = :TITLE, subtitle = :SUBTITLE ";
801 if (!newDescription.isNull())
802 sql +=
", description = :DESCRIPTION ";
803 sql +=
" WHERE chanid = :CHANID AND starttime = :START ;";
808 if (!newDescription.isNull())
809 query.
bindValue(
":DESCRIPTION", newDescription);
818 if (!newDescription.isNull())
832 query.
prepare(
"UPDATE recorded "
833 "SET transcoder = :PROFILEID "
834 "WHERE chanid = :CHANID "
835 "AND starttime = :START");
842 "in recorded table", query);
857 query.
prepare(
"UPDATE recorded "
858 "SET transcoder = 0 "
859 "WHERE chanid = :CHANID "
860 "AND starttime = :START");
866 "in recorded table", query);
871 pidquery.
prepare(
"SELECT r.id "
872 "FROM recordingprofiles r, profilegroups p "
873 "WHERE r.profilegroup = p.id "
874 "AND p.name = 'Transcoders' "
875 "AND r.name = :PROFILE ");
878 if (!pidquery.
exec())
881 "profile ID", query);
883 else if (pidquery.
next())
885 query.
prepare(
"UPDATE recorded "
886 "SET transcoder = :TRANSCODER "
887 "WHERE chanid = :CHANID "
888 "AND starttime = :START");
895 "in recorded table", query);
899 LOG(VB_GENERAL, LOG_ERR,
900 "ProgramInfo: unable to query transcoder profile ID");
947 uint chanid,
const QDateTime& recstartts)
951 LOG(VB_RECORD, LOG_WARNING,
952 QString(
"QueryRecordedIdFromKey: Invalid chanid %1").arg(chanid));
955 if (!recstartts.isValid())
957 LOG(VB_RECORD, LOG_WARNING,
958 QString(
"QueryRecordedIdFromKey: Invalid start ts %1")
959 .arg(recstartts.toString()));
965 "SELECT recordedid FROM recorded "
966 "WHERE chanid = :CHANID AND starttime = :RECSTARTTS");
968 query.
bindValue(
":RECSTARTTS", recstartts);
971 recordedid = query.
value(0).toUInt();
993 LOG(VB_FILE, LOG_INFO,
LOC + QString(
"StartedRecording: Recording to '%1'")
999 query.
prepare(
"DELETE FROM recordedseek WHERE chanid = :CHANID"
1000 " AND starttime = :START;");
1007 query.
prepare(
"DELETE FROM recordedmarkup WHERE chanid = :CHANID"
1008 " AND starttime = :START;");
1015 query.
prepare(
"REPLACE INTO recordedcredits"
1016 " SELECT * FROM credits"
1017 " WHERE chanid = :CHANID AND starttime = :START;");
1023 query.
prepare(
"REPLACE INTO recordedprogram"
1024 " SELECT * from program"
1025 " WHERE chanid = :CHANID AND starttime = :START"
1026 " AND title = :TITLE;");
1033 query.
prepare(
"REPLACE INTO recordedrating"
1034 " SELECT * from programrating"
1035 " WHERE chanid = :CHANID AND starttime = :START;");
1049 if (!dirname.isEmpty())
1051 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
1052 QString(
"InsertRecording: m_pathname was '%1'. "
1053 "This is usually blank.").arg(dirname));
1070 LOG(VB_GENERAL, LOG_ERR,
"Failed to insert new recording.");
1081 LOG(VB_GENERAL, LOG_ERR,
"Could not insert program");
1098 if (!query.
exec(
"LOCK TABLES recorded WRITE"))
1106 if (recgroupid == 0)
1108 query.
prepare(
"INSERT INTO recgroups SET recgroup = :NAME, "
1109 "displayname = :DISPLAYNAME");
1116 if (recgroupid <= 0)
1118 LOG(VB_GENERAL, LOG_ERR, QString(
"Could not create recording group (%1). "
1119 "Does it already exist?")
1127 " WHERE chanid = :CHANID AND "
1128 " starttime = :STARTS");
1137 else if (query.
next())
1139 LOG(VB_GENERAL, LOG_ERR,
1140 QString(
"RecordingInfo::InsertProgram(%1): ")
1141 .arg(pg->
toString()) +
"recording already exists...");
1150 if (!query.
exec(
"UNLOCK TABLES"))
1156 "INSERT INTO recorded "
1157 " (chanid, starttime, endtime, title, "
1158 " subtitle, description, season, episode, "
1159 " hostname, category, recgroup, autoexpire, "
1160 " recordid, seriesid, programid, inetref, "
1161 " stars, previouslyshown, originalairdate, "
1162 " findid, transcoder, playgroup, recpriority, "
1163 " basename, progstart, progend, profile, "
1164 " duplicate, storagegroup, inputname, recgroupid) "
1166 " (:CHANID, :STARTS, :ENDS, :TITLE, "
1167 " :SUBTITLE, :DESC, :SEASON, :EPISODE, "
1168 " :HOSTNAME, :CATEGORY, :RECGROUP, :AUTOEXP, "
1169 " :RECORDID, :SERIESID, :PROGRAMID, :INETREF, "
1170 " :STARS, :REPEAT, :ORIGAIRDATE, "
1171 " :FINDID, :TRANSCODER, :PLAYGROUP, :RECPRIORITY, "
1172 " :BASENAME, :PROGSTART, :PROGEND, :PROFILE, "
1173 " 0, :STORGROUP, :INPUTNAME, :RECGROUPID) "
1190 else if (pg->
m_year >= 1895)
1196 query.
bindValue(
":ORIGAIRDATE",
"0000-00-00");
1225 query.
bindValue(
":INPUTNAME", inputname);
1226 query.
bindValue(
":RECGROUPID", recgroupid);
1235 if (!query.
exec(
"UNLOCK TABLES"))
1245 query.
prepare(
"UPDATE channel SET last_record = NOW() "
1246 "WHERE chanid = :CHANID");
1251 query.
prepare(
"UPDATE record SET last_record = NOW() "
1252 "WHERE recordid = :RECORDID");
1259 query.
prepare(
"UPDATE record SET last_record = NOW() "
1260 "WHERE recordid = :PARENTID");
1296 query.
prepare(
"UPDATE recorded SET endtime = :ENDTIME, "
1297 " duplicate = :DUPLICATE "
1298 "WHERE chanid = :CHANID AND "
1299 " starttime = :STARTTIME ");
1303 query.
bindValue(
":DUPLICATE", !allowReRecord);
1314 qint64 endtime =
m_recEndTs.toSecsSinceEpoch();
1317 QString msg =
"Finished recording";
1318 QString msg_subtitle =
m_subtitle.isEmpty() ?
"" :
1320 QString details = QString(
"%1%2: channel %3")
1323 LOG(VB_GENERAL, LOG_INFO, QString(
"%1 %2").arg(msg, details));
1336 query.
prepare(
"UPDATE recorded SET endtime = :ENDTIME "
1337 "WHERE chanid = :CHANID AND "
1338 " starttime = :STARTTIME ");
1357 result.
prepare(
"UPDATE oldrecorded SET reactivate = 1 "
1358 "WHERE station = :STATION AND "
1359 " starttime = :STARTTIME AND "
1360 " title = :TITLE;");
1379 LOG(VB_SCHEDULE, LOG_INFO, QString(
"AddHistory: %1/%2, %3, %4, %5/%6")
1390 result.
prepare(
"REPLACE INTO oldrecorded (chanid,starttime,"
1391 "endtime,title,subtitle,description,season,episode,"
1392 "category,seriesid,programid,inetref,findid,recordid,"
1393 "station,rectype,recstatus,duplicate,reactivate,generic,"
1395 "VALUES(:CHANID,:START,:END,:TITLE,:SUBTITLE,:DESC,:SEASON,"
1396 ":EPISODE,:CATEGORY,:SERIESID,:PROGRAMID,:INETREF,"
1397 ":FINDID,:RECORDID,:STATION,:RECTYPE,:RECSTATUS,:DUPLICATE,"
1398 ":REACTIVATE,:GENERIC,:FUTURE);");
1426 result.
prepare(
"REPLACE INTO oldfind (recordid, findid) "
1427 "VALUES(:RECORDID,:FINDID);");
1450 result.
prepare(
"DELETE FROM oldrecorded WHERE title = :TITLE AND "
1451 "starttime = :START AND station = :STATION");
1461 result.
prepare(
"DELETE FROM oldfind WHERE "
1462 "recordid = :RECORDID AND findid = :FINDID");
1497 result.
prepare(
"UPDATE recorded SET duplicate = 0 "
1498 "WHERE chanid = :CHANID "
1499 "AND starttime = :STARTTIME "
1500 "AND title = :TITLE;");
1512 "UPDATE recorded SET duplicate = 0 "
1513 "WHERE duplicate = 1 AND "
1514 " title = :TITLE AND "
1516 " (:PROGRAMID1 <> '' AND "
1517 " :PROGRAMID2 = recorded.programid) "
1520 " (:PROGRAMID3 = '' OR recorded.programid = '' OR "
1521 " LEFT(:PROGRAMID4, LOCATE('/', :PROGRAMID5)) <> "
1522 " LEFT(recorded.programid, "
1523 " LOCATE('/', recorded.programid))) "
1525 " (((:DUPMETHOD1 & 0x02) = 0) OR (:SUBTITLE1 <> '' "
1526 " AND :SUBTITLE2 = recorded.subtitle)) "
1528 " (((:DUPMETHOD2 & 0x04) = 0) OR (:DESCRIPTION1 <> '' "
1529 " AND :DESCRIPTION2 = recorded.description)) "
1531 " (((:DUPMETHOD3 & 0x08) = 0) OR "
1532 " (:SUBTITLE3 <> '' AND "
1533 " (:SUBTITLE4 = recorded.subtitle OR "
1534 " (recorded.subtitle = '' AND "
1535 " :SUBTITLE5 = recorded.description))) OR "
1536 " (:SUBTITLE6 = '' AND :DESCRIPTION3 <> '' AND "
1537 " (:DESCRIPTION4 = recorded.subtitle OR "
1538 " (recorded.subtitle = '' AND "
1539 " :DESCRIPTION5 = recorded.description)))) "
1568 result.
prepare(
"UPDATE oldrecorded SET duplicate = 0 "
1569 "WHERE station = :STATION "
1570 "AND starttime = :STARTTIME "
1571 "AND title = :TITLE;");
1583 "UPDATE oldrecorded SET duplicate = 0 "
1584 "WHERE duplicate = 1 AND "
1585 " title = :TITLE AND "
1587 " (:PROGRAMID1 <> '' AND "
1588 " :PROGRAMID2 = oldrecorded.programid) "
1591 " (:PROGRAMID3 = '' OR oldrecorded.programid = '' OR "
1592 " LEFT(:PROGRAMID4, LOCATE('/', :PROGRAMID5)) <> "
1593 " LEFT(oldrecorded.programid, "
1594 " LOCATE('/', oldrecorded.programid))) "
1596 " (((:DUPMETHOD1 & 0x02) = 0) OR (:SUBTITLE1 <> '' "
1597 " AND :SUBTITLE2 = oldrecorded.subtitle)) "
1599 " (((:DUPMETHOD2 & 0x04) = 0) OR (:DESCRIPTION1 <> '' "
1600 " AND :DESCRIPTION2 = oldrecorded.description)) "
1602 " (((:DUPMETHOD3 & 0x08) = 0) OR "
1603 " (:SUBTITLE3 <> '' AND "
1604 " (:SUBTITLE4 = oldrecorded.subtitle OR "
1605 " (oldrecorded.subtitle = '' AND "
1606 " :SUBTITLE5 = oldrecorded.description))) OR "
1607 " (:SUBTITLE6 = '' AND :DESCRIPTION3 <> '' AND "
1608 " (:DESCRIPTION4 = oldrecorded.subtitle OR "
1609 " (oldrecorded.subtitle = '' AND "
1610 " :DESCRIPTION5 = oldrecorded.description)))) "
1639 result.
prepare(
"DELETE FROM oldrecorded "
1640 "WHERE recstatus = :NEVER AND duplicate = 0");
1649 result.
prepare(
"DELETE FROM oldfind WHERE "
1650 "recordid = :RECORDID AND findid = :FINDID");
1670 result.
prepare(
"UPDATE oldrecorded SET duplicate = 1 "
1671 "WHERE future = 0 AND duplicate = 0 "
1672 "AND title = :TITLE AND "
1673 "((programid = '' AND subtitle = :SUBTITLE"
1674 " AND description = :DESC) OR "
1675 " (programid <> '' AND programid = :PROGRAMID) OR "
1676 " (findid <> 0 AND findid = :FINDID))");
1695 str.replace(
"%RECID%", QString::number(
getRecordID()));
1696 str.replace(
"%PARENTID%", QString::number(
m_parentId));
1697 str.replace(
"%FINDID%", QString::number(
m_findId));
1698 str.replace(
"%RECSTATUS%", QString::number(
m_recStatus));
1699 str.replace(
"%RECTYPE%", QString::number(
m_recType));
1714 query.
prepare(
"SELECT recgroupid FROM recgroups WHERE recgroup = :RECGROUP");
1723 return query.
value(0).toUInt();
1733 query.
prepare(
"SELECT recgroup FROM recgroups WHERE recgroupid = :RECGROUPID");
1734 query.
bindValue(
":RECGROUPID", recGroupID);
1735 if (!query.
exec() || !query.
next())
1740 return query.
value(0).toString();
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
QVariant value(int i) const
int numRowsAffected() const
bool isActive(void) const
void bindValueNoNull(const QString &placeholder, const QVariant &val)
Add a single binding, taking care not to set a NULL value.
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
QVariant lastInsertId()
Return the id of the last inserted row.
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
QString GetHostName(void)
QString GetSetting(const QString &key, const QString &defaultval="")
static void DBError(const QString &where, const MSqlQuery &query)
void insert(uint recordedid, PIAction action, uint64_t filesize=0ULL)
Holds information on recordings and videos.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
QString GetBasename(void) const
static ProgramInfoUpdater * s_updater
VideoPropsType m_videoProperties
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
uint32_t m_programFlags
ProgramFlag.
virtual void SaveFilesize(uint64_t fsize)
Sets recording file size in database, and sets "filesize" field.
QString m_chanPlaybackFilters
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
void SetRecordingStatus(RecStatus::Type status)
void SetScheduledStartTime(const QDateTime &dt)
void SendAddedEvent(void) const
Sends event out that the ProgramInfo should be added to lists.
bool IsRepeat(void) const
void SaveTotalDuration(std::chrono::milliseconds duration)
Store the Total Duration at frame 0 in the recordedmarkup table.
QString CreateRecordBasename(const QString &ext) const
Returns a filename for a recording based on the recording channel and date.
QString GetHostname(void) const
static QStringList LoadFromScheduler(const QString &tmptable, int recordid)
virtual void SetFilesize(uint64_t sz)
bool IsReactivated(void) const
void SetScheduledEndTime(const QDateTime &dt)
QString GetStorageGroup(void) const
QString GetTitle(void) const
AudioPropsType m_audioProperties
bool IsGeneric(void) const
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
QString m_syndicatedEpisode
float m_stars
Rating, range [0..1].
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
QString GetInputName(void) const
virtual void SubstituteMatches(QString &str)
Subsitute MATCH% type variable names in the given string.
SubtitlePropsType m_subtitleProperties
virtual uint64_t GetFilesize(void) const
void SetRecordingEndTime(const QDateTime &dt)
virtual void clone(const ProgramInfo &other, bool ignore_non_serialized_data=false)
Copies important fields from other ProgramInfo.
RecStatus::Type GetRecordingStatus(void) const
void SetReactivated(bool reactivate)
void SendUpdateEvent(void) const
Sends event out that the ProgramInfo should be reloaded.
static QMutex s_staticDataLock
Holds information on a recording file and it's video and audio streams.
QString m_storageDeviceID
Holds information on a TV Program one might wish to record.
~RecordingInfo() override
Destructor deletes "record" if it exists.
QDateTime m_desiredRecStartTs
class RecordingRule * m_record
void SaveFilesize(uint64_t fsize) override
Sets recording file size in database, and sets "filesize" field.
void FinishedRecording(bool allowReRecord)
If not a premature stop, adds program to history of recorded programs.
void ApplyRecordPlayGroupChange(const QString &newplaygroup)
Sets the recording group, both in this RecordingInfo and in the database.
void SetDupHistory(void)
Set the duplicate flag in oldrecorded.
static QString GetRecgroupString(uint recGroupID)
Temporary helper during transition from string to ID.
void ApplyRecordStateChange(RecordingType newstate, bool save=true)
Sets RecordingType of "record", creating "record" if it does not exist.
void ApplyOriginalAirDateChange(QDate originalairdate)
void ApplyNeverRecord(void)
Set this program to never be recorded by inserting 'history' for it into the database with a status o...
void SubstituteMatches(QString &str) override
Replace MATCH% vars in the specified string.
void clear(void) override
RecordingRule * GetRecordingRule(void)
Returns the "record" field, creating it if necessary.
void ForgetHistory(void)
Forget the recording of a program so it will be recorded again.
bool InsertRecording(const QString &ext, bool force_match=false)
static bool QueryRecordedIdForKey(int &recordedid, uint chanid, const QDateTime &recstartts)
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.
static QString s_unknownTitle
RecStatus::Type m_oldrecstatus
void QuickRecord(void)
Create a kSingleRecord if not already scheduled.
void ApplyRecordRecGroupChange(const QString &newrecgroup)
Sets the recording group, both in this RecordingInfo and in the database.
void ReactivateRecording(void)
Asks the scheduler to restart this recording if possible.
static uint GetRecgroupID(const QString &recGroup)
Temporary helper during transition from string to ID.
static bool InsertProgram(RecordingInfo *pg, const RecordingRule *rule)
static const QRegularExpression kReLeadingAnd
int getRecordID(void)
Returns a record id, creating "record" it if necessary.
void ApplyStarsChange(float newstarsvalue)
Sets the stars value in the database.
QString GetProgramRecordingProfile(void) const
Returns recording profile name that will be, or was used, for this program, creating "record" field i...
int GetAutoRunJobs(void) const
Returns a bitmap of which jobs are attached to this RecordingInfo.
static const QRegularExpression kReSearchTypeName
void AddHistory(bool resched=true, bool forcedup=false, bool future=false)
Adds recording history, creating "record" it if necessary.
void ApplyRecordRecID(void)
Sets recordid to match RecordingRule recordid.
void SetFilesize(uint64_t fsize) override
void ApplyStorageGroupChange(const QString &newstoragegroup)
Sets the storage group, both in this RecordingInfo and in the database.
void UpdateRecordingEnd(void)
Update information in the recorded table when the end-time of a recording is changed.
void ApplyTranscoderProfileChangeById(int id)
uint64_t GetFilesize(void) const override
RecStatus::Type m_savedrecstatus
RecordingType GetProgramRecordingStatus(void)
Returns the recording type for this RecordingInfo, creating "record" field if necessary.
void DeleteHistory(void)
Deletes recording history, creating "record" it if necessary.
void ApplyRecordRecPriorityChange(int newrecpriority)
Sets recording priority of "record", creating "record" if it does not exist.
QDateTime m_desiredRecEndTs
RecordingFile * m_recordingFile
void StartedRecording(const QString &ext)
Inserts this RecordingInfo into the database as an existing recording.
void SetRecordingID(uint _recordedid) override
virtual void clone(const RecordingInfo &other, bool ignore_non_serialized_data=false)
Copies important fields from other RecordingInfo.
RecordingFile * GetRecordingFile() const
void ApplyTranscoderProfileChange(const QString &profile) const
Sets the transcoder profile for a recording.
Internal representation of a recording rule, mirrors the record table.
bool LoadByProgram(const ProgramInfo *proginfo)
int m_recordID
Unique Recording Rule ID.
bool Save(bool sendSig=true)
bool Delete(bool sendSig=true)
bool m_autoMetadataLookup
static void RescheduleCheck(const RecordingInfo &recinfo, const QString &why)
static void ReschedulePlace(const QString &why)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
bool LoadFromProgram(ProgramList &destination, const QString &where, const QString &groupBy, const QString &orderBy, const MSqlBindings &bindings, const ProgramList &schedList)
static eu8 clamp(eu8 value, eu8 low, eu8 high)
static const uint kUnknownProgramLength