Skip to content

Commit fd58289

Browse files
author
Robert McNamara
committed
DVR Service: Make GetRecordScheduleList work on an MBE.
Somehow I only tested this on my slave, development, BE. Existing method would not work on an MBE as the master cannot connect to itself. This makes a formerly private method in the scheduler public, but this seems relatively safe as it is only the DB query from the record table, and the subsequent filling of a RecInfo List.
1 parent a5325e3 commit fd58289

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

mythtv/programs/mythbackend/scheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Scheduler : public MThread, public MythScheduler
5757
virtual QMap<QString,ProgramInfo*> GetRecording(void) const;
5858

5959
void getAllScheduled(QStringList &strList);
60+
void findAllScheduledPrograms(RecList &proglist);
6061

6162
void getConflicting(RecordingInfo *pginfo, QStringList &strlist);
6263
void getConflicting(RecordingInfo *pginfo, RecList *retlist);
@@ -127,7 +128,6 @@ class Scheduler : public MThread, public MythScheduler
127128

128129
bool ChangeRecordingEnd(RecordingInfo *oldp, RecordingInfo *newp);
129130

130-
void findAllScheduledPrograms(RecList &proglist);
131131
bool CheckShutdownServer(int prerollseconds, QDateTime &idleSince,
132132
bool &blockShutdown);
133133
void ShutdownServer(int prerollseconds, QDateTime &idleSince);

mythtv/programs/mythbackend/services/dvr.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -426,41 +426,42 @@ bool Dvr::RemoveRecordSchedule ( uint nRecordId )
426426
DTC::RecRuleList* Dvr::GetRecordScheduleList( int nStartIndex,
427427
int nCount )
428428
{
429-
vector<ProgramInfo *> infoList;
430-
RemoteGetAllScheduledRecordings(infoList);
429+
RecList recList;
430+
Scheduler *sched = new Scheduler(false, NULL);
431+
sched->findAllScheduledPrograms(recList);
432+
433+
delete sched;
434+
sched = NULL;
431435

432436
// ----------------------------------------------------------------------
433437
// Build Response
434438
// ----------------------------------------------------------------------
435439

436440
DTC::RecRuleList *pRecRules = new DTC::RecRuleList();
437441

438-
nStartIndex = min( nStartIndex, (int)infoList.size() );
439-
nCount = (nCount > 0) ? min( nCount, (int)infoList.size() ) : infoList.size();
440-
int nEndIndex = min((nStartIndex + nCount), (int)infoList.size() );
442+
nStartIndex = min( nStartIndex, (int)recList.size() );
443+
nCount = (nCount > 0) ? min( nCount, (int)recList.size() ) : recList.size();
444+
int nEndIndex = min((nStartIndex + nCount), (int)recList.size() );
441445

442446
for( int n = nStartIndex; n < nEndIndex; n++)
443447
{
444-
RecordingRule *rule = new RecordingRule();
445-
ProgramInfo *pInfo = infoList[ n ];
446-
rule->LoadByProgram(pInfo);
448+
RecordingInfo *info = recList[n];
447449

448-
if (pInfo != NULL)
450+
if (info != NULL)
449451
{
450452
DTC::RecRule *pRecRule = pRecRules->AddNewRecRule();
451453

452-
FillRecRuleInfo( pRecRule, rule );
454+
FillRecRuleInfo( pRecRule, info->GetRecordingRule() );
453455

454-
delete rule;
455-
delete pInfo;
456+
delete info;
456457
}
457458
}
458459

459460
// ----------------------------------------------------------------------
460461

461462
pRecRules->setStartIndex ( nStartIndex );
462463
pRecRules->setCount ( nCount );
463-
pRecRules->setTotalAvailable( infoList.size() );
464+
pRecRules->setTotalAvailable( recList.size() );
464465
pRecRules->setAsOf ( QDateTime::currentDateTime() );
465466
pRecRules->setVersion ( MYTH_BINARY_VERSION );
466467
pRecRules->setProtoVer ( MYTH_PROTO_VERSION );

0 commit comments

Comments
 (0)