Skip to content

Commit

Permalink
Speedup cache update
Browse files Browse the repository at this point in the history
Don't override Globals::globalConfig.sIgnoreDLCCountRegex in Downloader::updateCache()
Changed how getting game details JSON is handled in Downloader::getGameDetailsThread
  • Loading branch information
Sude- committed Mar 27, 2023
1 parent 3f6b231 commit b520eb8
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/downloader.cpp
Expand Up @@ -2146,7 +2146,6 @@ void Downloader::updateCache()
Globals::globalConfig.dlConf.iInstallerPlatform = Util::getOptionValue("all", GlobalConstants::PLATFORMS);
Globals::globalConfig.dlConf.vLanguagePriority.clear();
Globals::globalConfig.dlConf.vPlatformPriority.clear();
Globals::globalConfig.sIgnoreDLCCountRegex = ".*"; // Ignore DLC count for all games because GOG doesn't report DLC count correctly

this->getGameList();
this->getGameDetails();
Expand Down Expand Up @@ -3524,23 +3523,23 @@ void Downloader::getGameDetailsThread(Config config, const unsigned int& tid)
game = galaxy->productInfoJsonToGameDetails(product_info, conf.dlConf);
game.filterWithPriorities(conf);

Json::Value gameDetailsJSON;
if ((conf.dlConf.bSaveSerials && game.serials.empty())
|| (conf.dlConf.bSaveChangelogs && game.changelog.empty())
)
{
Json::Value gameDetailsJSON;

if (!game_item.gamedetailsjson.empty())
gameDetailsJSON = game_item.gamedetailsjson;
if (!game_item.gamedetailsjson.empty())
gameDetailsJSON = game_item.gamedetailsjson;

if (conf.dlConf.bSaveSerials && game.serials.empty())
{
if (gameDetailsJSON.empty())
gameDetailsJSON = website->getGameDetailsJSON(game_item.id);
game.serials = Downloader::getSerialsFromJSON(gameDetailsJSON);
}

if (conf.dlConf.bSaveChangelogs && game.changelog.empty())
{
if (gameDetailsJSON.empty())
gameDetailsJSON = website->getGameDetailsJSON(game_item.id);
game.changelog = Downloader::getChangelogFromJSON(gameDetailsJSON);
if (conf.dlConf.bSaveSerials && game.serials.empty())
game.serials = Downloader::getSerialsFromJSON(gameDetailsJSON);

if (conf.dlConf.bSaveChangelogs && game.changelog.empty())
game.changelog = Downloader::getChangelogFromJSON(gameDetailsJSON);
}

game.makeFilepaths(conf.dirConf);
Expand Down

0 comments on commit b520eb8

Please sign in to comment.