Updated the ScreenScraper error handling slightly.

Also added the possibility to hide a folder in the same way as a game file.
This commit is contained in:
Leon Styhre 2020-07-28 23:15:35 +02:00
parent fe891812d3
commit 3cea714f9c
2 changed files with 9 additions and 1 deletions

View file

@ -43,7 +43,8 @@ MetaDataDecl folderDecls[] = {
{"developer", MD_STRING, "unknown", false, "developer", "enter game developer", true},
{"publisher", MD_STRING, "unknown", false, "publisher", "enter game publisher", true},
{"genre", MD_STRING, "unknown", false, "genre", "enter game genre", true},
{"players", MD_INT, "unknown", false, "players", "enter number of players", true}
{"players", MD_INT, "unknown", false, "players", "enter number of players", true},
{"hidden", MD_BOOL, "false", false, "hidden", "enter hidden off/on", false}
};
const std::vector<MetaDataDecl> folderMDD(folderDecls, folderDecls +
sizeof(folderDecls) / sizeof(folderDecls[0]));

View file

@ -176,6 +176,13 @@ void ScreenScraperRequest::process(const std::unique_ptr<HttpReq>& req,
assert(req->status() == HttpReq::REQ_SUCCESS);
pugi::xml_document doc;
// It seems as if screenscraper.fr has changed their API slightly and now just returns
// a simple text messsage upon not finding any matching game. If we don't return here,
// we will get a pugixml error trying to process this string as an XML message.
if (req->getContent().find("Erreur : Rom") == 0)
return;
pugi::xml_parse_result parseResult = doc.load_string(req->getContent().c_str());
if (!parseResult) {