timerlist: speed up loop when remote box is offline

Origin commit data
------------------
Commit: ab47d6bb1a
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-12-16 (Sun, 16 Dec 2018)

Origin message was:
------------------
- timerlist: speed up loop when remote box is offline
This commit is contained in:
vanhofen
2018-12-16 01:17:01 +01:00
parent 8e33547e37
commit 6be42e752d

View File

@@ -790,15 +790,15 @@ bool CTimerList::RemoteBoxChanExists(t_channel_id channel_id)
std::string errMsg = "";
Json::Value root;
bool ok = parseJsonFromString(r_url, &root, &errMsg);
if (!ok) {
if (!ok)
{
printf("Failed to parse JSON\n");
printf("%s\n", errMsg.c_str());
}
r_url = root.get("success","false").asString();
if (r_url == "false")
ShowMsg(LOCALE_REMOTEBOX_CHANNEL_NA, convertChannelId2String(channel_id),
CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 450, 30, false);
ShowMsg(LOCALE_REMOTEBOX_CHANNEL_NA, convertChannelId2String(channel_id), CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 450, 30, false);
return (r_url == "true");
}
@@ -850,11 +850,14 @@ void CTimerList::RemoteBoxTimerList(CTimerd::TimerList &rtimerlist)
std::string errMsg = "";
Json::Value root;
bool ok = parseJsonFromString(r_url, &root, &errMsg);
if (!ok) {
if (!ok)
{
printf("Failed to parse JSON\n");
printf("%s\n", errMsg.c_str());
it->online = false;
} else
continue;
}
else
it->online = true;
Json::Value delays = root["data"]["timer"][0];