/
v2dvr.h
355 lines (292 loc) · 18.1 KB
/
v2dvr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
//////////////////////////////////////////////////////////////////////////////
// Program Name: dvr.h
// Created : Mar. 7, 2011
//
// Copyright (c) 2011 David Blain <dblain@mythtv.org>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef V2DVR_H
#define V2DVR_H
#include "libmythbase/http/mythhttpservice.h"
#include "v2programList.h"
#include "v2cutList.h"
#include "v2markupList.h"
#include "v2encoderList.h"
#include "v2inputList.h"
#include "v2recRuleFilterList.h"
#include "v2titleInfoList.h"
#include "v2recRuleList.h"
#define DVR_SERVICE QString("/Dvr/")
#define DVR_HANDLE QString("Dvr")
class V2Dvr : public MythHTTPService
{
Q_OBJECT
Q_CLASSINFO("Version", "7.0")
Q_CLASSINFO("AddRecordedCredits", "methods=POST;name=bool")
Q_CLASSINFO("AddRecordedProgram", "methods=POST;name=int")
Q_CLASSINFO("RemoveRecorded", "methods=POST;name=bool")
Q_CLASSINFO("DeleteRecording", "methods=POST;name=bool")
Q_CLASSINFO("UnDeleteRecording", "methods=POST;name=bool")
Q_CLASSINFO("StopRecording", "methods=POST;name=bool")
Q_CLASSINFO("ReactivateRecording", "methods=POST;name=bool")
Q_CLASSINFO("RescheduleRecordings","methods=POST;name=bool")
Q_CLASSINFO("AllowReRecord", "methods=POST;name=bool")
Q_CLASSINFO("UpdateRecordedWatchedStatus","methods=POST;name=bool")
Q_CLASSINFO("GetSavedBookmark", "name=long")
Q_CLASSINFO("SetSavedBookmark", "name=bool")
Q_CLASSINFO("SetRecordedMarkup", "name=bool")
Q_CLASSINFO("AddRecordSchedule", "methods=POST;name=uint")
Q_CLASSINFO("UpdateRecordSchedule","methods=POST;name=bool")
Q_CLASSINFO("RemoveRecordSchedule","methods=POST;name=bool")
Q_CLASSINFO("AddDontRecordSchedule","methods=POST;name=bool")
Q_CLASSINFO("EnableRecordSchedule", "methods=POST;name=bool")
Q_CLASSINFO("DisableRecordSchedule","methods=POST;name=bool")
Q_CLASSINFO("RecordedIdForKey", "methods=GET,POST,HEAD;name=int")
Q_CLASSINFO("RecordedIdForPathname","methods=GET,POST,HEAD;name=int")
Q_CLASSINFO("RecStatusToString", "methods=GET,POST,HEAD;name=String")
Q_CLASSINFO("RecStatusToDescription","methods=GET,POST,HEAD;name=String")
Q_CLASSINFO("RecTypeToString", "methods=GET,POST,HEAD;name=String")
Q_CLASSINFO("RecTypeToDescription", "methods=GET,POST,HEAD;name=String")
Q_CLASSINFO("DupMethodToString", "methods=GET,POST,HEAD;name=String")
Q_CLASSINFO("DupMethodToDescription","methods=GET,POST,HEAD;name=String")
Q_CLASSINFO("DupInToString", "methods=GET,POST,HEAD;name=String")
Q_CLASSINFO("DupInToDescription", "methods=GET,POST,HEAD;name=String")
Q_CLASSINFO("ManageJobQueue", "methods=POST;name=int")
public:
V2Dvr();
~V2Dvr() = default;
static void RegisterCustomTypes();
public slots:
V2ProgramList* GetExpiringList ( int StartIndex,
int Count );
V2ProgramList* GetRecordedList ( bool Descending,
int StartIndex,
int Count,
const QString &TitleRegEx,
const QString &RecGroup,
const QString &StorageGroup,
const QString &Category,
const QString &Sort,
bool IgnoreLiveTV,
bool IgnoreDeleted);
V2ProgramList* GetOldRecordedList ( bool Descending,
int StartIndex,
int Count,
const QDateTime &StartTime,
const QDateTime &EndTime,
const QString &Title,
const QString &SeriesId,
int RecordId,
const QString &Sort);
V2Program* GetRecorded ( int RecordedId,
int ChanId,
const QDateTime &StartTime );
bool AddRecordedCredits ( int RecordedId,
const QJsonObject & json);
int AddRecordedProgram ( const QJsonObject & json);
bool RemoveRecorded ( int RecordedId,
int ChanId,
const QDateTime &StartTime,
bool ForceDelete,
bool AllowRerecord );
bool DeleteRecording ( int RecordedId,
int ChanId,
const QDateTime &StartTime,
bool ForceDelete,
bool AllowRerecord );
bool UnDeleteRecording ( int RecordedId,
int ChanId,
const QDateTime &StartTime );
bool StopRecording ( int RecordedId );
bool ReactivateRecording ( int RecordedId,
int ChanId,
const QDateTime &StartTime );
bool RescheduleRecordings( void );
bool AllowReRecord ( int RecordedId );
bool UpdateRecordedWatchedStatus ( int RecordedId,
int ChanId,
const QDateTime &StartTime,
bool Watched);
long GetSavedBookmark ( int RecordedId,
int ChanId,
const QDateTime &StartTime,
const QString &OffsetType );
bool SetSavedBookmark ( int RecordedId,
int ChanId,
const QDateTime &StartTime,
const QString &OffsetType,
long Offset
);
V2CutList* GetRecordedCutList ( int RecordedId,
int ChanId,
const QDateTime &StartTime,
const QString &OffsetType );
V2CutList* GetRecordedCommBreak ( int RecordedId,
int ChanId,
const QDateTime &StartTime,
const QString &OffsetType );
V2CutList* GetRecordedSeek ( int RecordedId,
const QString &OffsetType );
V2MarkupList* GetRecordedMarkup ( int RecordedId );
bool SetRecordedMarkup ( int RecordedId,
const QJsonObject & json );
V2ProgramList* GetConflictList ( int StartIndex,
int Count,
int RecordId );
V2ProgramList* GetUpcomingList ( int StartIndex,
int Count,
bool ShowAll,
int RecordId,
int RecStatus );
V2EncoderList* GetEncoderList ( );
V2InputList* GetInputList ( );
QStringList GetRecGroupList ( );
QStringList GetProgramCategories ( bool OnlyRecorded );
QStringList GetRecStorageGroupList ( );
QStringList GetPlayGroupList ( );
V2RecRuleFilterList* GetRecRuleFilterList ( );
QStringList GetTitleList ( const QString &RecGroup );
V2TitleInfoList* GetTitleInfoList ( );
// Recording Rules
uint AddRecordSchedule ( const QString& Title,
const QString& Subtitle,
const QString& Description,
const QString& Category,
const QDateTime& StartTime,
const QDateTime& EndTime,
const QString& SeriesId,
const QString& ProgramId,
int ChanId,
const QString& Station,
int FindDay,
QTime FindTime,
int ParentId,
bool Inactive,
uint Season,
uint Episode,
const QString& Inetref,
QString Type,
QString SearchType,
int RecPriority,
uint PreferredInput,
int StartOffset,
int EndOffset,
const QDateTime& LastRecorded,
QString DupMethod,
QString DupIn,
bool NewEpisOnly,
uint Filter,
QString RecProfile,
QString RecGroup,
QString StorageGroup,
QString PlayGroup,
bool AutoExpire,
int MaxEpisodes,
bool MaxNewest,
bool AutoCommflag,
bool AutoTranscode,
bool AutoMetaLookup,
bool AutoUserJob1,
bool AutoUserJob2,
bool AutoUserJob3,
bool AutoUserJob4,
int Transcoder);
bool UpdateRecordSchedule ( uint RecordId,
const QString& Title,
const QString& Subtitle,
const QString& Description,
const QString& Category,
const QDateTime& StartTime,
const QDateTime& EndTime,
const QString& SeriesId,
const QString& ProgramId,
int ChanId,
const QString& Station,
int FindDay,
QTime FindTime,
bool Inactive,
uint Season,
uint Episode,
const QString& Inetref,
QString Type,
QString SearchType,
int RecPriority,
uint PreferredInput,
int StartOffset,
int EndOffset,
QString DupMethod,
QString DupIn,
bool NewEpisOnly,
uint Filter,
QString RecProfile,
QString RecGroup,
QString StorageGroup,
QString PlayGroup,
bool AutoExpire,
int MaxEpisodes,
bool MaxNewest,
bool AutoCommflag,
bool AutoTranscode,
bool AutoMetaLookup,
bool AutoUserJob1,
bool AutoUserJob2,
bool AutoUserJob3,
bool AutoUserJob4,
int Transcoder);
bool RemoveRecordSchedule ( uint RecordId );
bool AddDontRecordSchedule( int ChanId,
const QDateTime &StartTime,
bool NeverRecord );
V2RecRuleList* GetRecordScheduleList( int StartIndex,
int Count,
const QString &Sort,
bool Descending );
V2RecRule* GetRecordSchedule ( uint RecordId,
const QString& Template,
int RecordedId,
int ChanId,
const QDateTime& StartTime,
bool MakeOverride );
bool EnableRecordSchedule ( uint RecordId );
bool DisableRecordSchedule( uint RecordId );
int RecordedIdForKey ( int ChanId,
const QDateTime &StartTime );
int RecordedIdForPathname( const QString &Pathname );
QString RecStatusToString ( int RecStatus );
QString RecStatusToDescription ( int RecStatus,
int RecType,
const QDateTime &StartTime );
QString RecTypeToString ( const QString& RecType );
QString RecTypeToDescription ( const QString& RecType );
QString DupMethodToString ( const QString& DupMethod );
QString DupMethodToDescription ( const QString& DupMethod );
QString DupInToString ( const QString& DupIn );
QString DupInToDescription ( const QString& DupIn );
int ManageJobQueue ( const QString &Action,
const QString &JobName,
int JobId,
int RecordedId,
QDateTime JobStartTime,
QString RemoteHost,
QString JobArgs );
private:
Q_DISABLE_COPY(V2Dvr)
};
#endif