Skip to content

Commit

Permalink
ServicesAPI: Add a AllowReRecord(recordedId) method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoet committed Jun 23, 2020
1 parent aab3bd2 commit 88ebff5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mythtv/libs/libmythservicecontracts/services/dvrServices.h
Expand Up @@ -45,7 +45,7 @@
class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
{
Q_OBJECT
Q_CLASSINFO( "version" , "6.6" )
Q_CLASSINFO( "version" , "6.7" )
Q_CLASSINFO( "RemoveRecorded_Method", "POST" )
Q_CLASSINFO( "DeleteRecording_Method", "POST" )
Q_CLASSINFO( "UnDeleteRecording", "POST" )
Expand Down Expand Up @@ -128,6 +128,8 @@ class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???

virtual bool RescheduleRecordings ( void ) = 0;

virtual bool AllowReRecord ( int RecordedId ) = 0;

virtual bool UpdateRecordedWatchedStatus ( int RecordedId,
int ChanId,
const QDateTime &StartTime,
Expand Down
19 changes: 19 additions & 0 deletions mythtv/programs/mythbackend/services/dvr.cpp
Expand Up @@ -424,6 +424,25 @@ bool Dvr::RescheduleRecordings(void)
//
/////////////////////////////////////////////////////////////////////////////

bool Dvr::AllowReRecord ( int RecordedId )
{
if (RecordedId <= 0)
throw QString("RecordedId param is invalid.");

RecordingInfo ri = RecordingInfo(RecordedId);

if (!ri.GetChanID())
throw QString("RecordedId %1 not found").arg(RecordedId);

ri.ForgetHistory();

return true;
}

/////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////

bool Dvr::UpdateRecordedWatchedStatus ( int RecordedId,
int chanid,
const QDateTime &recstarttsRaw,
Expand Down
2 changes: 2 additions & 0 deletions mythtv/programs/mythbackend/services/dvr.h
Expand Up @@ -90,6 +90,8 @@ class Dvr : public DvrServices

bool RescheduleRecordings( void ) override; // DvrServices

bool AllowReRecord ( int RecordedId ) override;

bool UpdateRecordedWatchedStatus ( int RecordedId,
int ChanId,
const QDateTime &recstarttsRaw,
Expand Down

0 comments on commit 88ebff5

Please sign in to comment.