diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index 73d1ccb71..a6124ad11 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -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); } diff --git a/es-app/src/guis/GuiScraperSearch.h b/es-app/src/guis/GuiScraperSearch.h index 7c16a237e..85f0e358e 100644 --- a/es-app/src/guis/GuiScraperSearch.h +++ b/es-app/src/guis/GuiScraperSearch.h @@ -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(mScraperResults.size()); } diff --git a/es-app/src/scrapers/Scraper.h b/es-app/src/scrapers/Scraper.h index 3a0bba15f..5649e8506 100644 --- a/es-app/src/scrapers/Scraper.h +++ b/es-app/src/scrapers/Scraper.h @@ -38,6 +38,7 @@ struct ScraperSearchParams { FileData* game; std::string nameOverride; + bool automaticMode; }; struct ScraperSearchResult { diff --git a/es-app/src/scrapers/ScreenScraper.cpp b/es-app/src/scrapers/ScreenScraper.cpp index 0281f89f1..a54bcfc11 100644 --- a/es-app/src/scrapers/ScreenScraper.cpp +++ b/es-app/src/scrapers/ScreenScraper.cpp @@ -172,9 +172,10 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params, std::vector& 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) + diff --git a/es-app/src/scrapers/ScreenScraper.h b/es-app/src/scrapers/ScreenScraper.h index 5fa1c6201..189d05bb1 100644 --- a/es-app/src/scrapers/ScreenScraper.h +++ b/es-app/src/scrapers/ScreenScraper.h @@ -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.