mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Scraper allowance information is now logged as debug info.
This commit is contained in:
parent
513a10d723
commit
2ee67407d8
|
@ -432,8 +432,10 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr<HttpReq>& req,
|
|||
doc["remaining_monthly_allowance"].GetInt() +
|
||||
doc["extra_allowance"].GetInt();
|
||||
}
|
||||
LOG(LogDebug) << "TheGamesDBJSONRequest::process(): "
|
||||
"Remaining monthly scraping allowance: " <<
|
||||
results.back().scraperRequestAllowance;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -236,7 +236,9 @@ void ScreenScraperRequest::processGame(const pugi::xml_document& xmldoc,
|
|||
result.gameID = game.attribute("id").as_string();
|
||||
|
||||
// Find how many more requests we can make before the scraper request
|
||||
// allowance counter is reset.
|
||||
// allowance counter is reset. For some strange reason the ssuser information
|
||||
// is not provided for all games even though the request looks identical apart
|
||||
// from the game name.
|
||||
unsigned requestsToday =
|
||||
data.child("ssuser").child("requeststoday").text().as_uint();
|
||||
unsigned maxRequestsPerDay =
|
||||
|
@ -331,6 +333,16 @@ void ScreenScraperRequest::processGame(const pugi::xml_document& xmldoc,
|
|||
result.mdl.get("players");
|
||||
}
|
||||
|
||||
if (maxRequestsPerDay > 0) {
|
||||
LOG(LogDebug) << "ScreenScraperRequest::processGame(): Daily scraping allowance: " <<
|
||||
requestsToday << "/" << maxRequestsPerDay << " (" <<
|
||||
result.scraperRequestAllowance << " remaining).";
|
||||
}
|
||||
else {
|
||||
LOG(LogDebug) << "ScreenScraperRequest::processGame(): Daily scraping allowance: "
|
||||
"No statistics were provided with the response.";
|
||||
}
|
||||
|
||||
// Media super-node.
|
||||
pugi::xml_node media_list = game.child("medias");
|
||||
|
||||
|
|
Loading…
Reference in a new issue