Skip to content

Commit

Permalink
Fix scheduler output ordering.
Browse files Browse the repository at this point in the history
Backport of 8b9c595 and 20abad4 to fixes/0.24.
  • Loading branch information
gigem committed Aug 16, 2011
1 parent 515171d commit c502e0d
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions mythtv/programs/mythbackend/scheduler.cpp
Expand Up @@ -279,7 +279,11 @@ static bool comp_recstart(RecordingInfo *a, RecordingInfo *b)
return a->GetRecordingEndTime() < b->GetRecordingEndTime();
if (a->GetChannelSchedulingID() != b->GetChannelSchedulingID())
return a->GetChannelSchedulingID() < b->GetChannelSchedulingID();
return a->GetRecordingStatus() < b->GetRecordingStatus();
if (a->GetRecordingStatus() != b->GetRecordingStatus())
return a->GetRecordingStatus() < b->GetRecordingStatus();
if (a->GetChanNum() != b->GetChanNum())
return a->GetChanNum() < b->GetChanNum();
return a->GetChanID() < b->GetChanID();
}

static QDateTime schedTime;
Expand Down Expand Up @@ -325,17 +329,6 @@ static bool comp_priority(RecordingInfo *a, RecordingInfo *b)
return a->GetRecordingRuleID() < b->GetRecordingRuleID();
}

static bool comp_timechannel(RecordingInfo *a, RecordingInfo *b)
{
if (a->GetRecordingStartTime() != b->GetRecordingStartTime())
return a->GetRecordingStartTime() < b->GetRecordingStartTime();
if (a->GetChanNum() == b->GetChanNum())
return a->GetChanID() < b->GetChanID();
if (a->GetChanNum().toInt() > 0 && b->GetChanNum().toInt() > 0)
return a->GetChanNum().toInt() < b->GetChanNum().toInt();
return a->GetChanNum() < b->GetChanNum();
}

bool Scheduler::FillRecordList(bool doLock)
{
schedMoveHigher = (bool)gCoreContext->GetNumSetting("SchedMoveHigher");
Expand Down Expand Up @@ -1519,8 +1512,6 @@ bool Scheduler::getAllPending(RecList *retList)
retList->push_back(new RecordingInfo(**it));
}

SORT_RECLIST(*retList, comp_timechannel);

return hasconflicts;
}

Expand Down

0 comments on commit c502e0d

Please sign in to comment.