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)
131 m_stars = std::clamp(_stars, 0.0F, 1.0F);
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");
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 chanid = :CHANID"
689 " AND starttime = :START ;");
691 query.
bindValue(
":RECGROUPID", newrecgroupid);
709 if (newrecgroupid > 0)
713 query.
prepare(
"UPDATE recorded"
714 " SET recgroup = :RECGROUP, "
715 " recgroupid = :RECGROUPID "
716 " WHERE chanid = :CHANID"
717 " AND starttime = :START ;");
719 query.
bindValue(
":RECGROUPID", newrecgroupid);
732 LOG(VB_GENERAL, LOG_NOTICE,
733 QString(
"ApplyRecordRecGroupChange: %1 to %2 (%3)")
734 .arg(
m_recGroup, newrecgroup).arg(newrecgroupid));
746 query.
prepare(
"UPDATE recorded"
747 " SET playgroup = :PLAYGROUP"
748 " WHERE chanid = :CHANID"
749 " AND starttime = :START ;");
771 query.
prepare(
"UPDATE recorded"
772 " SET storagegroup = :STORAGEGROUP"
773 " WHERE chanid = :CHANID"
774 " AND starttime = :START ;");
795 const QString &newSubtitle,
const QString &newDescription)
798 QString sql =
"UPDATE recorded SET title = :TITLE, subtitle = :SUBTITLE ";
799 if (!newDescription.isNull())
800 sql +=
", description = :DESCRIPTION ";
801 sql +=
" WHERE chanid = :CHANID AND starttime = :START ;";
806 if (!newDescription.isNull())
807 query.
bindValue(
":DESCRIPTION", newDescription);
816 if (!newDescription.isNull())
830 query.
prepare(
"UPDATE recorded "
831 "SET transcoder = :PROFILEID "
832 "WHERE chanid = :CHANID "
833 "AND starttime = :START");
840 "in recorded table", query);
855 query.
prepare(
"UPDATE recorded "
856 "SET transcoder = 0 "
857 "WHERE chanid = :CHANID "
858 "AND starttime = :START");
864 "in recorded table", query);
869 pidquery.
prepare(
"SELECT r.id "
870 "FROM recordingprofiles r, profilegroups p "
871 "WHERE r.profilegroup = p.id "
872 "AND p.name = 'Transcoders' "
873 "AND r.name = :PROFILE ");
876 if (!pidquery.
exec())
879 "profile ID", query);
881 else if (pidquery.
next())
883 query.
prepare(
"UPDATE recorded "
884 "SET transcoder = :TRANSCODER "
885 "WHERE chanid = :CHANID "
886 "AND starttime = :START");
893 "in recorded table", query);
897 LOG(VB_GENERAL, LOG_ERR,
898 "ProgramInfo: unable to query transcoder profile ID");
945 uint chanid,
const QDateTime& recstartts)
949 LOG(VB_RECORD, LOG_WARNING,
950 QString(
"QueryRecordedIdFromKey: Invalid chanid %1").arg(chanid));
953 if (!recstartts.isValid())
955 LOG(VB_RECORD, LOG_WARNING,
956 QString(
"QueryRecordedIdFromKey: Invalid start ts %1")
957 .arg(recstartts.toString()));
963 "SELECT recordedid FROM recorded "
964 "WHERE chanid = :CHANID AND starttime = :RECSTARTTS");
966 query.
bindValue(
":RECSTARTTS", recstartts);
969 recordedid = query.
value(0).toUInt();
991 LOG(VB_FILE, LOG_INFO,
LOC + QString(
"StartedRecording: Recording to '%1'")
997 query.
prepare(
"DELETE FROM recordedseek WHERE chanid = :CHANID"
998 " AND starttime = :START;");
1005 query.
prepare(
"DELETE FROM recordedmarkup WHERE chanid = :CHANID"
1006 " AND starttime = :START;");
1013 query.
prepare(
"REPLACE INTO recordedcredits"
1014 " SELECT * FROM credits"
1015 " WHERE chanid = :CHANID AND starttime = :START;");
1021 query.
prepare(
"REPLACE INTO recordedprogram"
1022 " SELECT * from program"
1023 " WHERE chanid = :CHANID AND starttime = :START"
1024 " AND title = :TITLE;");
1031 query.
prepare(
"REPLACE INTO recordedrating"
1032 " SELECT * from programrating"
1033 " WHERE chanid = :CHANID AND starttime = :START;");
1047 if (!dirname.isEmpty())
1049 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
1050 QString(
"InsertRecording: m_pathname was '%1'. "
1051 "This is usually blank.").arg(dirname));
1068 LOG(VB_GENERAL, LOG_ERR,
"Failed to insert new recording.");
1079 LOG(VB_GENERAL, LOG_ERR,
"Could not insert program");
1096 if (!query.
exec(
"LOCK TABLES recorded WRITE"))
1105 " WHERE chanid = :CHANID AND "
1106 " starttime = :STARTS");
1115 else if (query.
next())
1117 LOG(VB_GENERAL, LOG_ERR,
1118 QString(
"RecordingInfo::InsertProgram(%1): ")
1119 .arg(pg->
toString()) +
"recording already exists...");
1128 if (!query.
exec(
"UNLOCK TABLES"))
1134 "INSERT INTO recorded "
1135 " (chanid, starttime, endtime, title, "
1136 " subtitle, description, season, episode, "
1137 " hostname, category, recgroup, autoexpire, "
1138 " recordid, seriesid, programid, inetref, "
1139 " stars, previouslyshown, originalairdate, "
1140 " findid, transcoder, playgroup, recpriority, "
1141 " basename, progstart, progend, profile, "
1142 " duplicate, storagegroup, inputname, recgroupid) "
1144 " (:CHANID, :STARTS, :ENDS, :TITLE, "
1145 " :SUBTITLE, :DESC, :SEASON, :EPISODE, "
1146 " :HOSTNAME, :CATEGORY, :RECGROUP, :AUTOEXP, "
1147 " :RECORDID, :SERIESID, :PROGRAMID, :INETREF, "
1148 " :STARS, :REPEAT, :ORIGAIRDATE, "
1149 " :FINDID, :TRANSCODER, :PLAYGROUP, :RECPRIORITY, "
1150 " :BASENAME, :PROGSTART, :PROGEND, :PROFILE, "
1151 " 0, :STORGROUP, :INPUTNAME, :RECGROUPID) "
1168 else if (pg->
m_year >= 1895)
1174 query.
bindValue(
":ORIGAIRDATE",
"0000-00-00");
1203 query.
bindValue(
":INPUTNAME", inputname);
1204 query.
bindValue(
":RECGROUPID", recgroupid);
1213 if (!query.
exec(
"UNLOCK TABLES"))
1223 query.
prepare(
"UPDATE channel SET last_record = NOW() "
1224 "WHERE chanid = :CHANID");
1229 query.
prepare(
"UPDATE record SET last_record = NOW() "
1230 "WHERE recordid = :RECORDID");
1237 query.
prepare(
"UPDATE record SET last_record = NOW() "
1238 "WHERE recordid = :PARENTID");
1274 query.
prepare(
"UPDATE recorded SET endtime = :ENDTIME, "
1275 " duplicate = :DUPLICATE "
1276 "WHERE chanid = :CHANID AND "
1277 " starttime = :STARTTIME ");
1281 query.
bindValue(
":DUPLICATE", !allowReRecord);
1292 qint64 endtime =
m_recEndTs.toSecsSinceEpoch();
1295 QString msg =
"Finished recording";
1296 QString msg_subtitle =
m_subtitle.isEmpty() ?
"" :
1298 QString details = QString(
"%1%2: channel %3")
1301 LOG(VB_GENERAL, LOG_INFO, QString(
"%1 %2").arg(msg, details));
1314 query.
prepare(
"UPDATE recorded SET endtime = :ENDTIME "
1315 "WHERE chanid = :CHANID AND "
1316 " starttime = :STARTTIME ");
1335 result.
prepare(
"UPDATE oldrecorded SET reactivate = 1 "
1336 "WHERE station = :STATION AND "
1337 " starttime = :STARTTIME AND "
1338 " title = :TITLE;");
1357 LOG(VB_SCHEDULE, LOG_INFO, QString(
"AddHistory: %1/%2, %3, %4, %5/%6")
1368 result.
prepare(
"REPLACE INTO oldrecorded (chanid,starttime,"
1369 "endtime,title,subtitle,description,season,episode,"
1370 "category,seriesid,programid,inetref,findid,recordid,"
1371 "station,rectype,recstatus,duplicate,reactivate,generic,"
1373 "VALUES(:CHANID,:START,:END,:TITLE,:SUBTITLE,:DESC,:SEASON,"
1374 ":EPISODE,:CATEGORY,:SERIESID,:PROGRAMID,:INETREF,"
1375 ":FINDID,:RECORDID,:STATION,:RECTYPE,:RECSTATUS,:DUPLICATE,"
1376 ":REACTIVATE,:GENERIC,:FUTURE);");
1404 result.
prepare(
"REPLACE INTO oldfind (recordid, findid) "
1405 "VALUES(:RECORDID,:FINDID);");
1428 result.
prepare(
"DELETE FROM oldrecorded WHERE title = :TITLE AND "
1429 "starttime = :START AND station = :STATION");
1439 result.
prepare(
"DELETE FROM oldfind WHERE "
1440 "recordid = :RECORDID AND findid = :FINDID");
1475 result.
prepare(
"UPDATE recorded SET duplicate = 0 "
1476 "WHERE chanid = :CHANID "
1477 "AND starttime = :STARTTIME "
1478 "AND title = :TITLE;");
1490 "UPDATE recorded SET duplicate = 0 "
1491 "WHERE duplicate = 1 AND "
1492 " title = :TITLE AND "
1494 " (:PROGRAMID1 <> '' AND "
1495 " :PROGRAMID2 = recorded.programid) "
1498 " (:PROGRAMID3 = '' OR recorded.programid = '' OR "
1499 " LEFT(:PROGRAMID4, LOCATE('/', :PROGRAMID5)) <> "
1500 " LEFT(recorded.programid, "
1501 " LOCATE('/', recorded.programid))) "
1503 " (((:DUPMETHOD1 & 0x02) = 0) OR (:SUBTITLE1 <> '' "
1504 " AND :SUBTITLE2 = recorded.subtitle)) "
1506 " (((:DUPMETHOD2 & 0x04) = 0) OR (:DESCRIPTION1 <> '' "
1507 " AND :DESCRIPTION2 = recorded.description)) "
1509 " (((:DUPMETHOD3 & 0x08) = 0) OR "
1510 " (:SUBTITLE3 <> '' AND "
1511 " (:SUBTITLE4 = recorded.subtitle OR "
1512 " (recorded.subtitle = '' AND "
1513 " :SUBTITLE5 = recorded.description))) OR "
1514 " (:SUBTITLE6 = '' AND :DESCRIPTION3 <> '' AND "
1515 " (:DESCRIPTION4 = recorded.subtitle OR "
1516 " (recorded.subtitle = '' AND "
1517 " :DESCRIPTION5 = recorded.description)))) "
1546 result.
prepare(
"UPDATE oldrecorded SET duplicate = 0 "
1547 "WHERE station = :STATION "
1548 "AND starttime = :STARTTIME "
1549 "AND title = :TITLE;");
1561 "UPDATE oldrecorded SET duplicate = 0 "
1562 "WHERE duplicate = 1 AND "
1563 " title = :TITLE AND "
1565 " (:PROGRAMID1 <> '' AND "
1566 " :PROGRAMID2 = oldrecorded.programid) "
1569 " (:PROGRAMID3 = '' OR oldrecorded.programid = '' OR "
1570 " LEFT(:PROGRAMID4, LOCATE('/', :PROGRAMID5)) <> "
1571 " LEFT(oldrecorded.programid, "
1572 " LOCATE('/', oldrecorded.programid))) "
1574 " (((:DUPMETHOD1 & 0x02) = 0) OR (:SUBTITLE1 <> '' "
1575 " AND :SUBTITLE2 = oldrecorded.subtitle)) "
1577 " (((:DUPMETHOD2 & 0x04) = 0) OR (:DESCRIPTION1 <> '' "
1578 " AND :DESCRIPTION2 = oldrecorded.description)) "
1580 " (((:DUPMETHOD3 & 0x08) = 0) OR "
1581 " (:SUBTITLE3 <> '' AND "
1582 " (:SUBTITLE4 = oldrecorded.subtitle OR "
1583 " (oldrecorded.subtitle = '' AND "
1584 " :SUBTITLE5 = oldrecorded.description))) OR "
1585 " (:SUBTITLE6 = '' AND :DESCRIPTION3 <> '' AND "
1586 " (:DESCRIPTION4 = oldrecorded.subtitle OR "
1587 " (oldrecorded.subtitle = '' AND "
1588 " :DESCRIPTION5 = oldrecorded.description)))) "
1617 result.
prepare(
"DELETE FROM oldrecorded "
1618 "WHERE recstatus = :NEVER AND duplicate = 0");
1627 result.
prepare(
"DELETE FROM oldfind WHERE "
1628 "recordid = :RECORDID AND findid = :FINDID");
1648 result.
prepare(
"UPDATE oldrecorded SET duplicate = 1 "
1649 "WHERE future = 0 AND duplicate = 0 "
1650 "AND title = :TITLE AND "
1651 "((programid = '' AND subtitle = :SUBTITLE"
1652 " AND description = :DESC) OR "
1653 " (programid <> '' AND programid = :PROGRAMID) OR "
1654 " (findid <> 0 AND findid = :FINDID))");
1673 str.replace(
"%RECID%", QString::number(
getRecordID()));
1674 str.replace(
"%PARENTID%", QString::number(
m_parentId));
1675 str.replace(
"%FINDID%", QString::number(
m_findId));
1676 str.replace(
"%RECSTATUS%", QString::number(
m_recStatus));
1677 str.replace(
"%RECTYPE%", QString::number(
m_recType));
1692 query.
prepare(
"SELECT recgroupid FROM recgroups WHERE recgroup = :RECGROUP");
1701 return query.
value(0).toUInt();
1711 query.
prepare(
"SELECT recgroup FROM recgroups WHERE recgroupid = :RECGROUPID");
1712 query.
bindValue(
":RECGROUPID", recGroupID);
1713 if (!query.
exec() || !query.
next())
1718 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 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.