mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Made ScreenScraper searches in automatic mode faster and more accurate.
This commit is contained in:
parent
90f3f6cb07
commit
aed9c4abe5
|
@ -314,7 +314,7 @@ void GuiScraperSearch::updateViewStyle()
|
|||
}
|
||||
}
|
||||
|
||||
void GuiScraperSearch::search(const ScraperSearchParams& params)
|
||||
void GuiScraperSearch::search(ScraperSearchParams& params)
|
||||
{
|
||||
mBlockAccept = true;
|
||||
mAcceptedResult = false;
|
||||
|
@ -330,6 +330,15 @@ void GuiScraperSearch::search(const ScraperSearchParams& params)
|
|||
mMDResolveHandle.reset();
|
||||
updateInfoPane();
|
||||
|
||||
// For ScreenScraper we always want to use the jeuInfos (single-game) API call when in
|
||||
// automatic mode as this scraper service is not sorting the multi-search results based
|
||||
// on most relevant result (as TheGamesDB does). Using jeuInfos is also much faster than
|
||||
// using the jeuRecherche API call (multi-game search).
|
||||
if (mSearchType == ALWAYS_ACCEPT_FIRST_RESULT)
|
||||
params.automaticMode = true;
|
||||
else
|
||||
params.automaticMode = false;
|
||||
|
||||
mLastSearch = params;
|
||||
mSearchHandle = startScraperSearch(params);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
GuiScraperSearch(SearchType searchType, unsigned int scrapeCount = 1);
|
||||
~GuiScraperSearch();
|
||||
|
||||
void search(const ScraperSearchParams& params);
|
||||
void search(ScraperSearchParams& params);
|
||||
void openInputScreen(ScraperSearchParams& from);
|
||||
void stop();
|
||||
int getScraperResultsSize() { return static_cast<int>(mScraperResults.size()); }
|
||||
|
|
|
@ -38,6 +38,7 @@ struct ScraperSearchParams {
|
|||
FileData* game;
|
||||
|
||||
std::string nameOverride;
|
||||
bool automaticMode;
|
||||
};
|
||||
|
||||
struct ScraperSearchResult {
|
||||
|
|
|
@ -172,9 +172,10 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params,
|
|||
std::vector<ScraperSearchResult>& results)
|
||||
{
|
||||
std::string path;
|
||||
|
||||
ScreenScraperRequest::ScreenScraperConfig ssConfig;
|
||||
|
||||
ssConfig.automaticMode = params.automaticMode;
|
||||
|
||||
if (params.game->isArcadeGame())
|
||||
ssConfig.isArcadeSystem = true;
|
||||
else
|
||||
|
@ -743,7 +744,7 @@ std::string ScreenScraperRequest::ScreenScraperConfig::getGameSearchUrl(
|
|||
singleSearch = true;
|
||||
}
|
||||
|
||||
if (singleSearch) {
|
||||
if (automaticMode || singleSearch) {
|
||||
screenScraperURL = API_URL_BASE + "/jeuInfos.php?devid=" +
|
||||
Utils::String::scramble(API_DEV_U, API_DEV_KEY) +
|
||||
"&devpassword=" + Utils::String::scramble(API_DEV_P, API_DEV_KEY) +
|
||||
|
|
|
@ -82,6 +82,7 @@ public:
|
|||
std::string media_video = "video";
|
||||
|
||||
bool isArcadeSystem;
|
||||
bool automaticMode;
|
||||
|
||||
// Which Region to use when selecting the artwork.
|
||||
// Applies to: artwork, name of the game, date of release.
|
||||
|
|
Loading…
Reference in a new issue