Skip to content

Commit d34a498

Browse files
author
Robert McNamara
committed
ProgramInfo: Add a couple methods to update the Season, Episode, and Inetref.
Slow DB sets. Currently using them in an external app so nothing that should bother the UI.
1 parent e6ce251 commit d34a498

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

mythtv/libs/libmyth/programinfo.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3653,6 +3653,41 @@ void ProgramInfo::UpdateInUseMark(bool force)
36533653
MarkAsInUse(true);
36543654
}
36553655

3656+
void ProgramInfo::SaveSeasonEpisode(uint seas, uint ep)
3657+
{
3658+
MSqlQuery query(MSqlQuery::InitCon());
3659+
3660+
query.prepare(
3661+
"UPDATE recorded "
3662+
"SET season = :SEASON, episode = :EPISODE "
3663+
"WHERE chanid = :CHANID AND starttime = :STARTTIME");
3664+
3665+
query.bindValue(":SEASON", seas);
3666+
query.bindValue(":EPISODE", ep);
3667+
query.bindValue(":CHANID", chanid);
3668+
query.bindValue(":STARTTIME", recstartts);
3669+
query.exec();
3670+
3671+
SendUpdateEvent();
3672+
}
3673+
3674+
void ProgramInfo::SaveInetRef(const QString &inet)
3675+
{
3676+
MSqlQuery query(MSqlQuery::InitCon());
3677+
3678+
query.prepare(
3679+
"UPDATE recorded "
3680+
"SET inetref = :INETREF "
3681+
"WHERE chanid = :CHANID AND starttime = :STARTTIME");
3682+
3683+
query.bindValue(":INETREF", inet);
3684+
query.bindValue(":CHANID", chanid);
3685+
query.bindValue(":STARTTIME", recstartts);
3686+
query.exec();
3687+
3688+
SendUpdateEvent();
3689+
}
3690+
36563691
/** \brief Attempts to ascertain if the main file for this ProgramInfo
36573692
* is readable.
36583693
* \note This method often initiates a QUERY_CHECKFILE MythProto

mythtv/libs/libmyth/programinfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ class MPUBLIC ProgramInfo
541541
void UpdateLastDelete(bool setTime) const;
542542
void MarkAsInUse(bool inuse, QString usedFor = "");
543543
void UpdateInUseMark(bool force = false);
544+
void SaveSeasonEpisode(uint seas, uint ep);
545+
void SaveInetRef(const QString &inet);
544546

545547
// Extremely slow functions that cannot be called from the UI thread.
546548
QString DiscoverRecordingDirectory(void) const;

mythtv/libs/libmythbase/mythversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// Update this whenever the plug-in API changes.
1313
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
1414
/// libmythui class methods used by plug-ins.
15-
#define MYTH_BINARY_VERSION "0.25.20110702-2"
15+
#define MYTH_BINARY_VERSION "0.25.20110702-3"
1616

1717
/** \brief Increment this whenever the MythTV network protocol changes.
1818
*

0 commit comments

Comments
 (0)