mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
Improved some scraper logging.
This commit is contained in:
parent
3922fdd40a
commit
190bb839ec
|
@ -550,12 +550,22 @@ void GuiScraperMenu::pressedStart()
|
|||
std::vector<SystemData*> sys = mSystems->getSelectedObjects();
|
||||
for (auto it = sys.cbegin(); it != sys.cend(); it++) {
|
||||
if ((*it)->getPlatformIds().empty()) {
|
||||
std::string warningString;
|
||||
if (sys.size() == 1) {
|
||||
warningString = "The selected system does not have a\n"
|
||||
"platform set, results may be inaccurate\n"
|
||||
"Continue anyway?";
|
||||
}
|
||||
else {
|
||||
warningString = "At least one of your selected\n"
|
||||
"systems does not have a platform\n"
|
||||
"set, results may be inaccurate\n"
|
||||
"Continue anyway?";
|
||||
}
|
||||
mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(),
|
||||
Utils::String::toUpper("Warning: some of your selected systems do not "
|
||||
"have a platform set. Results may be even more inaccurate than "
|
||||
"usual!\nContinue anyway?"),
|
||||
"YES", std::bind(&GuiScraperMenu::start, this),
|
||||
"NO", nullptr));
|
||||
Utils::String::toUpper(warningString),
|
||||
"YES", std::bind(&GuiScraperMenu::start, this),
|
||||
"NO", nullptr));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -176,12 +176,15 @@ void thegamesdb_generate_json_scraper_requests(const ScraperSearchParams& params
|
|||
first = false;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "TheGamesDB scraper - no support for platform " <<
|
||||
getPlatformName(*platformIt);
|
||||
LOG(LogWarning) << "TheGamesDB scraper: No support for platform \"" <<
|
||||
getPlatformName(*platformIt) << "\", search will be inaccurate";
|
||||
}
|
||||
}
|
||||
path += platformQueryParam;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "TheGamesDB scraper: No platform defined, search will be inaccurate";
|
||||
}
|
||||
|
||||
requests.push(std::unique_ptr<ScraperRequest>
|
||||
(new TheGamesDBJSONRequest(requests, results, path)));
|
||||
|
|
|
@ -36,10 +36,15 @@ std::unique_ptr<ScraperSearchHandle> startScraperSearch(const ScraperSearchParam
|
|||
std::unique_ptr<ScraperSearchHandle> handle(new ScraperSearchHandle());
|
||||
|
||||
// Check if the scraper in the settings still exists as a registered scraping source.
|
||||
if (scraper_request_funcs.find(name) == scraper_request_funcs.end())
|
||||
LOG(LogWarning) << "Configured scraper (" << name << ") unavailable, scraping aborted";
|
||||
else
|
||||
if (scraper_request_funcs.find(name) == scraper_request_funcs.end()) {
|
||||
LOG(LogError) << "Configured scraper (" << name << ") unavailable, scraping aborted";
|
||||
}
|
||||
else {
|
||||
LOG(LogDebug) << "Scraper::startScraperSearch(): Scraping system \"" <<
|
||||
params.system->getName() << "\", game file \"" <<
|
||||
params.game->getFileName() << "\"";
|
||||
scraper_request_funcs.at(name)(params, handle->mRequestQueue, handle->mResults);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
|
|
@ -193,14 +193,21 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params,
|
|||
p_ids.push_back(mapIt->second);
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "ScreenScraper: no support for platform " <<
|
||||
getPlatformName(*platformIt);
|
||||
LOG(LogWarning) << "ScreenScraper: No support for platform \"" <<
|
||||
getPlatformName(*platformIt) << "\", search will be inaccurate";
|
||||
// Add the scrape request without a platform/system ID.
|
||||
requests.push(std::unique_ptr<ScraperRequest>
|
||||
(new ScreenScraperRequest(requests, results, path)));
|
||||
}
|
||||
}
|
||||
|
||||
if (p_ids.size() == 0) {
|
||||
LOG(LogWarning) << "ScreenScraper: No platform defined, search will be inaccurate";
|
||||
// Add the scrape request without a platform/system ID.
|
||||
requests.push(std::unique_ptr<ScraperRequest>
|
||||
(new ScreenScraperRequest(requests, results, path)));
|
||||
}
|
||||
|
||||
// Sort the platform IDs and remove duplicates.
|
||||
std::sort(p_ids.begin(), p_ids.end());
|
||||
auto last = std::unique(p_ids.begin(), p_ids.end());
|
||||
|
|
Loading…
Reference in a new issue