mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
Use parseJsonFromString() for parsing json data in
- CMoviePlayerGui::luaGetUrl() - CTimerList::RemoteBoxChanExists() - CTimerList::RemoteBoxTimerList() - CTimerList::paintItem() - cTmdb::GetMovieDetails() - cYTFeedParser::parseFeedJSON() - cYTFeedParser::parseFeedDetailsJSON()
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "system/settings.h"
|
||||
#include "system/helpers.h"
|
||||
#include <system/helpers-json.h>
|
||||
#include "system/set_threadname.h"
|
||||
#include "gui/widget/hintbox.h"
|
||||
|
||||
@@ -197,12 +198,12 @@ bool cTmdb::GetMovieDetails(std::string lang)
|
||||
if (!getUrl(url, answer))
|
||||
return false;
|
||||
|
||||
string errMsg = "";
|
||||
Json::Value root;
|
||||
Json::Reader reader;
|
||||
bool parsedSuccess = reader.parse(answer, root, false);
|
||||
if (!parsedSuccess) {
|
||||
bool ok = parseJsonFromString(answer, &root, &errMsg);
|
||||
if (!ok) {
|
||||
printf("Failed to parse JSON\n");
|
||||
printf("%s\n", reader.getFormattedErrorMessages().c_str());
|
||||
printf("%s\n", errMsg.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -219,10 +220,11 @@ bool cTmdb::GetMovieDetails(std::string lang)
|
||||
answer.clear();
|
||||
if (!getUrl(url, answer))
|
||||
return false;
|
||||
parsedSuccess = reader.parse(answer, root, false);
|
||||
if (!parsedSuccess) {
|
||||
|
||||
ok = parseJsonFromString(answer, &root, &errMsg);
|
||||
if (!ok) {
|
||||
printf("Failed to parse JSON\n");
|
||||
printf("%s\n", reader.getFormattedErrorMessages().c_str());
|
||||
printf("%s\n", errMsg.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user