From f7d0ec11a7550e7f74c45df4f26851fc8ae11c13 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 1 Sep 2018 14:34:25 +0200 Subject: [PATCH] fix repeating remotetimers Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/340a72842b4916c7c8e2517264260eed0b644a4b Author: TangoCash Date: 2018-09-01 (Sat, 01 Sep 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/timerlist.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index eb077c1c6..4a2f0e497 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -457,6 +457,14 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) r_url += "&channel_id=" + string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timerlist[selected].channel_id); r_url += "&aj=on"; r_url += "&rs=on"; + if (timerlist[selected].eventRepeat > CTimerd::TIMERREPEAT_ONCE) { + r_url += "&rep=" + to_string((int)timerlist[selected].eventRepeat); + r_url += "&repcount=" + to_string((int)timerlist[selected].repeatCount); + } + if (timerlist[selected].eventRepeat >= CTimerd::TIMERREPEAT_WEEKDAYS) { + Timer->setWeekdaysToStr(timerlist[selected].eventRepeat, m_weekdaysStr); + r_url += "&wd=" + m_weekdaysStr; + } //printf("[remotetimer] url:%s\n",r_url.c_str()); r_url = httpTool.downloadString(r_url, -1, httpConnectTimeout); //printf("[remotetimer] status:%s\n",r_url.c_str()); @@ -483,6 +491,12 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) TIMERD_APIDS_CONF, true, timerlist[selected].announceTime > time(NULL),"",true); } } + if (res > 0) + Timer->modifyTimerEvent(res, timerlist[selected].announceTime + timerlist[selected].rem_pre, + timerlist[selected].alarmTime + timerlist[selected].rem_pre, + timerlist[selected].stopTime - timerlist[selected].rem_post, + timerlist[selected].eventRepeat, + timerlist[selected].repeatCount); CHTTPTool httpTool; std::string r_url; @@ -520,6 +534,14 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) r_url += "&channel_id=" + string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timerlist[selected].channel_id); r_url += "&aj=on"; r_url += "&rs=on"; + if (timerlist[selected].eventRepeat > CTimerd::TIMERREPEAT_ONCE) { + r_url += "&rep=" + to_string((int)timerlist[selected].eventRepeat); + r_url += "&repcount=" + to_string((int)timerlist[selected].repeatCount); + } + if (timerlist[selected].eventRepeat >= CTimerd::TIMERREPEAT_WEEKDAYS) { + Timer->setWeekdaysToStr(timerlist[selected].eventRepeat, m_weekdaysStr); + r_url += "&wd=" + m_weekdaysStr; + } //printf("[remotetimer] url:%s\n",r_url.c_str()); r_url = httpTool.downloadString(r_url, -1, httpConnectTimeout); //printf("[remotetimer] status:%s\n",r_url.c_str());