From 70d2fdbefc2a2d22c0b05fd0d996c7c2fa6db4fa Mon Sep 17 00:00:00 2001 From: Sude Date: Thu, 26 Aug 2021 13:26:13 +0300 Subject: [PATCH] Add option --use-dlc-list Adds new option --use-dlc-list to enable using DLC list. Previously the downloader used DLC list by default which made getting game details very slow for not much benefit. This makes the downloader not use DLC list by default and thus getting game details is much faster. Before and after result of listing games with 212 game collection using "time lgogdownloader --list" Before real 0m36,135s user 0m0,159s sys 0m0,039s After real 0m2,226s user 0m0,048s sys 0m0,019s --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 0df9004..21807a8 100644 --- a/main.cpp +++ b/main.cpp @@ -168,6 +168,7 @@ int main(int argc, char *argv[]) bool bNoSubDirectories = false; bool bNoPlatformDetection = false; bool bNoGalaxyDependencies = false; + bool bUseDLCList = false; std::string sInstallerPlatform; std::string sInstallerLanguage; std::string sIncludeOptions; @@ -243,6 +244,7 @@ int main(int argc, char *argv[]) ("save-changelogs", bpo::value(&Globals::globalConfig.dlConf.bSaveChangelogs)->zero_tokens()->default_value(false), "Save changelogs when downloading") ("threads", bpo::value(&Globals::globalConfig.iThreads)->default_value(4), "Number of download threads") ("info-threads", bpo::value(&Globals::globalConfig.iInfoThreads)->default_value(4), "Number of threads for getting product info") + ("use-dlc-list", bpo::value(&bUseDLCList)->zero_tokens()->default_value(false), "Use DLC list specified with --dlc-list") ("dlc-list", bpo::value(&Globals::globalConfig.sGameHasDLCList)->default_value("https://raw.githubusercontent.com/Sude-/lgogdownloader-lists/master/game_has_dlc.txt"), "Set URL for list of games that have DLC") ("progress-interval", bpo::value(&Globals::globalConfig.iProgressInterval)->default_value(100), "Set interval for progress bar update (milliseconds)\nValue must be between 1 and 10000") ("lowspeed-timeout", bpo::value(&Globals::globalConfig.curlConf.iLowSpeedTimeout)->default_value(30), "Set time in number seconds that the transfer speed should be below the rate set with --lowspeed-rate for it to considered too slow and aborted") @@ -379,9 +381,12 @@ int main(int argc, char *argv[]) } } + if (!bUseDLCList) + Globals::globalConfig.sGameHasDLCList = ""; + if (Globals::globalConfig.sIgnoreDLCCountRegex.empty()) { - if (boost::filesystem::exists(Globals::globalConfig.sGameHasDLCListFilePath)) + if (boost::filesystem::exists(Globals::globalConfig.sGameHasDLCListFilePath) && bUseDLCList) { std::ifstream ifs(Globals::globalConfig.sGameHasDLCListFilePath.c_str()); if (!ifs)