diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 11a23039b..bacbb2909 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -2825,7 +2825,8 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) eventinfo.epgID = 0; eventinfo.epg_starttime = 0; eventinfo.apids = TIMERD_APIDS_CONF; - eventinfo.recordingSafety = (hh->ParamList["rs"] == "1"); + eventinfo.recordingSafety = (hh->ParamList["rs"] == "1") || (hh->ParamList["rs"] == "on"); + eventinfo.autoAdjustToEPG = (hh->ParamList["aj"] == "1") || (hh->ParamList["aj"] == "on"); // channel by Id or name if(!hh->ParamList["channel_id"].empty()) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 2547995ac..21a8643d1 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1193,7 +1193,7 @@ void CTimerEvent_Record::fireEvent() { if (adjustToCurrentEPG()) return; - Refresh(); + getEpgId(); CTimerd::RecordingInfo ri=eventInfo; ri.eventID=eventID; strcpy(ri.recordingDir, recordingDir.substr(0,sizeof(ri.recordingDir)-1).c_str()); @@ -1331,7 +1331,17 @@ bool CTimerEvent_Record::adjustToCurrentEPG() if (first == evtlist.end()) return false; - CTimerEvent_Record *event= new CTimerEvent_Record(first->startTime - (alarmTime - announceTime), first->startTime, first->startTime + first->duration, + time_t _announceTime = first->startTime - (alarmTime - announceTime); + time_t _alarmTime = first->startTime; + time_t _stopTime = first->startTime + first->duration; + if (recordingSafety) { + int pre, post; + CTimerManager::getInstance()->getRecordingSafety(pre, post); + _alarmTime -= pre; + _stopTime += post; + } + + CTimerEvent_Record *event= new CTimerEvent_Record(_announceTime, _alarmTime, _stopTime, eventInfo.channel_id, eventInfo.epgID, first->startTime, eventInfo.apids, CTimerd::TIMERREPEAT_ONCE, 1, recordingDir, recordingSafety, autoAdjustToEPG, eventInfo.channel_ci); //NI