- timerlist/controlapi: enable epg_starttime for remote timers

This commit is contained in:
TangoCash
2019-04-28 21:17:37 +02:00
committed by Thilo Graf
parent e5c3777150
commit 8ea412cc55
3 changed files with 12 additions and 5 deletions

View File

@@ -721,10 +721,6 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan
return timer->eventType;
}
}
if (timer->eventType == CTimerd::TIMER_REMOTEBOX && timer->alarmTime + timer->rem_pre == event->startTime) {
printf("alarmTime: %ld + rem_pre %d = startTime %ld ?\n",timer->alarmTime, timer->rem_pre, event->startTime);
return timer->eventType;
}
}
}
return (CTimerd::CTimerEventTypes) 0;

View File

@@ -439,6 +439,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
r_url += "/control/timer?action=new&update=1";
r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime);
r_url += "&stop=" + to_string((int)timerlist[selected].stopTime);
r_url += "&start=" + to_string((int)timerlist[selected].epg_starttime);
r_url += "&announce=" + to_string((int)timerlist[selected].announceTime);
r_url += "&channel_id=" + string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timerlist[selected].channel_id);
r_url += "&aj=on";
@@ -468,6 +469,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
r_url += "/control/timer?action=new";
r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime + pre);
r_url += "&stop=" + to_string((int)timerlist[selected].stopTime - post);
r_url += "&start=" + to_string((int)timerlist[selected].epg_starttime);
r_url += "&announce=" + to_string((int)timerlist[selected].announceTime + pre);
r_url += "&channel_id=" + string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timerlist[selected].channel_id);
r_url += "&aj=on";
@@ -539,6 +541,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey)
r_url += "/control/timer?action=new&update=1";
r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime);
r_url += "&stop=" + to_string((int)timerlist[selected].stopTime);
r_url += "&start=" + to_string((int)timerlist[selected].epg_starttime);
r_url += "&announce=" + to_string((int)timerlist[selected].announceTime);
r_url += "&channel_id=" + string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timerlist[selected].channel_id);
r_url += "&aj=on";
@@ -878,6 +881,7 @@ void CTimerList::RemoteBoxTimerList(CTimerd::TimerList &rtimerlist)
rtimer.alarmTime = (time_t) atoll(remotetimers[i]["alarm"][0].get("digits","").asString().c_str());
rtimer.announceTime = (time_t) atoll(remotetimers[i]["announce"][0].get("digits","").asString().c_str());
rtimer.stopTime = (time_t) atoll(remotetimers[i]["stop"][0].get("digits","").asString().c_str());
rtimer.epg_starttime = (time_t) atoll(remotetimers[i]["start"][0].get("digits","").asString().c_str());
sscanf(remotetimers[i].get("epg_id","").asString().c_str(), SCANF_CHANNEL_ID_TYPE, &rtimer.epg_id);
sscanf(remotetimers[i].get("channel_id","").asString().c_str(), SCANF_CHANNEL_ID_TYPE, &rtimer.channel_id);
strncpy(rtimer.epgTitle,remotetimers[i].get("title","").asString().c_str(),sizeof(rtimer.epgTitle));

View File

@@ -2636,6 +2636,13 @@ void CControlAPI::SendTimers(CyhookHandler *hh)
timer_item += hh->outArray("stop", stop, true);
}
// epg_starttime
std::string start = "";
struct tm *startTime = localtime(&(timer->epg_starttime));
start += hh->outArrayItem("normal", _SendTime(hh, startTime, (int)timer->epg_starttime), false);
timer_item += hh->outArray("start", start, true);
// repeat
std::string repeat = "";
@@ -2984,7 +2991,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
CTimerd::RecordingInfo recinfo;
CTimerd::EventInfo eventinfo;
eventinfo.epg_id = 0;
eventinfo.epg_starttime = 0;
eventinfo.epg_starttime = atoi(hh->ParamList["start"].c_str());
eventinfo.apids = TIMERD_APIDS_CONF;
eventinfo.recordingSafety = (hh->ParamList["rs"] == "1") || (hh->ParamList["rs"] == "on");
eventinfo.autoAdjustToEPG = (hh->ParamList["aj"] == "1") || (hh->ParamList["aj"] == "on");