mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Fixed an issue where duplicate ScreenScraper game entries could show up in the interactive scraper if multiple platforms were defined for the system
This commit is contained in:
parent
82338d9b90
commit
fc24b21311
|
@ -301,6 +301,21 @@ void ScreenScraperRequest::process(const std::unique_ptr<HttpReq>& req,
|
|||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
it = results.erase(it);
|
||||
LOG(LogDebug) << "ScreenScraperRequest::process(): Removed duplicate entry";
|
||||
}
|
||||
else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenScraperRequest::processGame(const pugi::xml_document& xmldoc,
|
||||
|
|
Loading…
Reference in a new issue