Skip to content

Commit 82226ea

Browse files
author
Robert McNamara
committed
Services API: Fix GetUpcoming API.
For some reason, the third item in was getting lost. I didn't exactly track down why that was happening, but by changing the iterator to match the one used in the scheduler, all items are present and accounted for.
1 parent af48243 commit 82226ea

File tree

1 file changed

+9
-8
lines changed
  • mythtv/programs/mythbackend/services

1 file changed

+9
-8
lines changed

mythtv/programs/mythbackend/services/dvr.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,24 +210,25 @@ DTC::ProgramList* Dvr::GetUpcoming( int nStartIndex,
210210
int nCount,
211211
bool bShowAll )
212212
{
213-
ProgramList recordingList;
214-
ProgramList tmpList;
213+
RecordingList recordingList;
214+
RecordingList tmpList(false);
215215
bool hasConflicts;
216216
LoadFromScheduler(tmpList, hasConflicts);
217217

218218
// Sort the upcoming into only those which will record
219-
for( uint n = 0; n < tmpList.size(); n++)
219+
RecordingList::iterator it = tmpList.begin();
220+
for(; it < tmpList.end(); ++it)
220221
{
221-
if (!bShowAll && (tmpList[n]->GetRecordingStatus() <= rsWillRecord) &&
222-
(tmpList[n]->GetRecordingStartTime() >=
222+
if (!bShowAll && ((*it)->GetRecordingStatus() <= rsWillRecord) &&
223+
((*it)->GetRecordingStartTime() >=
223224
QDateTime::currentDateTime()))
224225
{
225-
recordingList.push_back(tmpList.take(n));
226+
recordingList.push_back(*it);
226227
}
227-
else if (bShowAll && (tmpList[n]->GetRecordingStartTime() >=
228+
else if (bShowAll && ((*it)->GetRecordingStartTime() >=
228229
QDateTime::currentDateTime()))
229230
{
230-
recordingList.push_back(tmpList.take(n));
231+
recordingList.push_back(*it);
231232
}
232233
}
233234

0 commit comments

Comments
 (0)