mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Leading and trailing whitespaces are now trimmed from TheGamesDB scraper searches.
This commit is contained in:
parent
8f82809a89
commit
e507335923
|
@ -158,6 +158,18 @@ void thegamesdb_generate_json_scraper_requests(
|
||||||
cleanName = params.game->getCleanName();
|
cleanName = params.game->getCleanName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Trim leading and trailing whitespaces.
|
||||||
|
cleanName.erase(cleanName.begin(),
|
||||||
|
std::find_if(cleanName.begin(), cleanName.end(), [](char c) {
|
||||||
|
return !std::isspace(static_cast<unsigned char>(c));
|
||||||
|
}));
|
||||||
|
cleanName.erase(
|
||||||
|
std::find_if(cleanName.rbegin(), cleanName.rend(),
|
||||||
|
[](char c) { return !std::isspace(static_cast<unsigned char>(c)); })
|
||||||
|
.base(),
|
||||||
|
cleanName.end());
|
||||||
|
|
||||||
path += "/Games/ByGameName?" + apiKey +
|
path += "/Games/ByGameName?" + apiKey +
|
||||||
"&fields=players,publishers,genres,overview,last_updated,rating,"
|
"&fields=players,publishers,genres,overview,last_updated,rating,"
|
||||||
"platform,coop,youtube,os,processor,ram,hdd,video,sound,alternates&name=" +
|
"platform,coop,youtube,os,processor,ram,hdd,video,sound,alternates&name=" +
|
||||||
|
|
Loading…
Reference in a new issue