Scraper allowance information is now logged as debug info.

This commit is contained in:
Leon Styhre 2020-08-06 12:52:06 +02:00
parent 513a10d723
commit 2ee67407d8
2 changed files with 16 additions and 2 deletions

View file

@ -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;
}

View file

@ -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");