diff --git a/es-app/src/scrapers/ScreenScraper.cpp b/es-app/src/scrapers/ScreenScraper.cpp index b701d423c..19226591f 100644 --- a/es-app/src/scrapers/ScreenScraper.cpp +++ b/es-app/src/scrapers/ScreenScraper.cpp @@ -313,13 +313,16 @@ void ScreenScraperRequest::process(const std::unique_ptr& req, // If there are multiple platforms defined for the system, then it's possible that the scraper // service will return the same results for each platform, so we need to remove such duplicates. if (results.size() > 1) { - const std::string gameID {results.front().gameID}; - for (auto it = results.cbegin() + 1; it != results.cend();) { - if ((*it).gameID == gameID) { + std::vector gameIDs; + for (auto it = results.cbegin(); it != results.cend();) { + if (std::find(gameIDs.begin(), gameIDs.end(), (*it).gameID) != gameIDs.end()) { + LOG(LogDebug) + << "ScreenScraperRequest::process(): Removed duplicate entry for game ID " + << (*it).gameID; it = results.erase(it); - LOG(LogDebug) << "ScreenScraperRequest::process(): Removed duplicate entry"; } else { + gameIDs.emplace_back((*it).gameID); ++it; } }