mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-21 21:55:38 +00:00
Added a more informative error message than 'HTTP error code 430' when exceeding the daily ScreenScraper quota
This commit is contained in:
parent
5560ca9408
commit
83baa5b5d0
|
@ -35,7 +35,7 @@ namespace
|
|||
|
||||
std::unique_ptr<ScraperSearchHandle> startScraperSearch(const ScraperSearchParams& params)
|
||||
{
|
||||
std::string name = Settings::getInstance()->getString("Scraper");
|
||||
std::string name {Settings::getInstance()->getString("Scraper")};
|
||||
// Handle a potentially invalid entry in the configuration file.
|
||||
if (name != "screenscraper" && name != "thegamesdb") {
|
||||
name = "screenscraper";
|
||||
|
|
|
@ -263,8 +263,13 @@ HttpReq::Status HttpReq::status()
|
|||
long responseCode;
|
||||
curl_easy_getinfo(msg->easy_handle, CURLINFO_RESPONSE_CODE, &responseCode);
|
||||
|
||||
if (responseCode == 404 && mScraperRequest &&
|
||||
Settings::getInstance()->getBool("ScraperIgnoreHTTP404Errors")) {
|
||||
if (responseCode == 430 &&
|
||||
Settings::getInstance()->getString("Scraper") == "screenscraper") {
|
||||
req->mContent << "You have exceeded your daily scrape quota";
|
||||
req->mStatus = REQ_SUCCESS;
|
||||
}
|
||||
else if (responseCode == 404 && mScraperRequest &&
|
||||
Settings::getInstance()->getBool("ScraperIgnoreHTTP404Errors")) {
|
||||
req->mStatus = REQ_RESOURCE_NOT_FOUND;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue