Skip to content

Commit 090167b

Browse files
author
Robert McNamara
committed
Services API: Add a RemoveRecordedItem API.
Does just what is says, and is therefore POST only. http://BackendServerIP:6544/Dvr/RemoveRecordedItem?ChanId=1234&StartTime=2011-03-14T08:00:00
1 parent 32b21f3 commit 090167b

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

mythtv/libs/libmythservicecontracts/services/dvrServices.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
4949
{
5050
Q_OBJECT
51-
Q_CLASSINFO( "version" , "1.1" );
51+
Q_CLASSINFO( "version" , "1.11" );
52+
Q_CLASSINFO( "RemoveRecordedItem_Method", "POST" )
5253

5354
public:
5455

@@ -73,6 +74,9 @@ class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ???
7374
virtual DTC::Program* GetRecordedItem ( int ChanId,
7475
const QDateTime &StartTime ) = 0;
7576

77+
virtual bool RemoveRecordedItem ( int ChanId,
78+
const QDateTime &StartTime ) = 0;
79+
7680
virtual DTC::ProgramList* GetConflicts ( int StartIndex,
7781
int Count ) = 0;
7882

mythtv/programs/mythbackend/services/dvr.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "autoexpire.h"
3131
#include "jobqueue.h"
3232
#include "encoderlink.h"
33+
#include "remoteutil.h"
3334

3435
#include "serviceUtil.h"
3536

@@ -118,6 +119,26 @@ DTC::Program* Dvr::GetRecordedItem( int nChanId,
118119
//
119120
/////////////////////////////////////////////////////////////////////////////
120121

122+
bool Dvr::RemoveRecordedItem( int nChanId,
123+
const QDateTime &dStartTime )
124+
{
125+
if (nChanId <= 0 || !dStartTime.isValid())
126+
throw( QString("Channel ID or StartTime appears invalid."));
127+
128+
bool bResult = false;
129+
130+
ProgramInfo *pInfo = new ProgramInfo(nChanId, dStartTime);
131+
132+
if (pInfo->HasPathname())
133+
bResult = RemoteDeleteRecording(nChanId, dStartTime, true, false);
134+
135+
return bResult;
136+
}
137+
138+
/////////////////////////////////////////////////////////////////////////////
139+
//
140+
/////////////////////////////////////////////////////////////////////////////
141+
121142
DTC::ProgramList* Dvr::GetExpiring( int nStartIndex,
122143
int nCount )
123144
{

mythtv/programs/mythbackend/services/dvr.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class Dvr : public DvrServices
4646
DTC::Program* GetRecordedItem ( int ChanId,
4747
const QDateTime &StartTime );
4848

49+
bool RemoveRecordedItem ( int ChanId,
50+
const QDateTime &StartTime );
51+
4952
DTC::ProgramList* GetConflicts ( int StartIndex,
5053
int Count );
5154

0 commit comments

Comments
 (0)