Ticket #4879: myth_schedule_slack.diff

File myth_schedule_slack.diff, 1.5 KB (added by ard.biesheuvel@…, 12 years ago)
  • scheduler.cpp

     
    23762376                 << "/" << whereclauses[clause] << endl;
    23772377    }
    23782378
     2379    int startTimeSlack = gContext->GetNumSetting( "StartTimeSlack", 0);
     2380
    23792381    for (clause = 0; clause < fromclauses.count(); clause++)
    23802382    {
    23812383        QString query = QString(
     
    24002402"  AND "
    24012403"  ((RECTABLE.type = %5) " // channelrecord
    24022404"   OR"
    2403 "   ((TIME_TO_SEC(RECTABLE.starttime) = TIME_TO_SEC(program.starttime)) " // timeslot matches
     2405"   (720-ABS(ABS(TIMESTAMPDIFF(MINUTE,program.starttime,ADDTIME(RECTABLE.startdate,RECTABLE.starttime))% 1440) -720) <= %6"
    24042406"    AND "
    2405 "    ((RECTABLE.type = %6) " // timeslotrecord
     2407"    ((RECTABLE.type = %7) " // timeslotrecord
    24062408"     OR"
    2407 "     ((DAYOFWEEK(RECTABLE.startdate) = DAYOFWEEK(program.starttime) "
     2409"     ((5040-ABS(ABS(TIMESTAMPDIFF(MINUTE,program.starttime,ADDTIME(RECTABLE.startdate,RECTABLE.starttime))% 10080) -5040) <= %8"
    24082410"      AND "
    2409 "      ((RECTABLE.type = %7) " // weekslotrecord
     2411"      ((RECTABLE.type = %9) " // weekslotrecord
    24102412"       OR"
    24112413"       ((TO_DAYS(RECTABLE.startdate) = TO_DAYS(program.starttime)) " // date matches
    24122414"        )"
     
    24232425            .arg(kFindDailyRecord)
    24242426            .arg(kFindWeeklyRecord)
    24252427            .arg(kChannelRecord)
     2428            .arg(startTimeSlack)
    24262429            .arg(kTimeslotRecord)
     2430            .arg(startTimeSlack)
    24272431            .arg(kWeekslotRecord);
    24282432
    24292433        while (1)