Add a flag to avoid hash checks

This commit is contained in:
Dmitry Khalanskiy 2021-09-12 10:25:37 +03:00
parent f69747bb88
commit 554de90f46
3 changed files with 3 additions and 1 deletions

View File

@ -218,6 +218,7 @@ class Config
bool bShowWishlist; bool bShowWishlist;
bool bNotifications; bool bNotifications;
bool bIncludeHiddenProducts; bool bIncludeHiddenProducts;
bool bSizeOnly;
bool bVerbose; bool bVerbose;
bool bUnicode; // use Unicode in console output bool bUnicode; // use Unicode in console output

View File

@ -257,6 +257,7 @@ int main(int argc, char *argv[])
("lowspeed-timeout", bpo::value<long int>(&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") ("lowspeed-timeout", bpo::value<long int>(&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")
("lowspeed-rate", bpo::value<long int>(&Globals::globalConfig.curlConf.iLowSpeedTimeoutRate)->default_value(200), "Set average transfer speed in bytes per second that the transfer should be below during time specified with --lowspeed-timeout for it to be considered too slow and aborted") ("lowspeed-rate", bpo::value<long int>(&Globals::globalConfig.curlConf.iLowSpeedTimeoutRate)->default_value(200), "Set average transfer speed in bytes per second that the transfer should be below during time specified with --lowspeed-timeout for it to be considered too slow and aborted")
("include-hidden-products", bpo::value<bool>(&Globals::globalConfig.bIncludeHiddenProducts)->zero_tokens()->default_value(false), "Include games that have been set hidden in account page") ("include-hidden-products", bpo::value<bool>(&Globals::globalConfig.bIncludeHiddenProducts)->zero_tokens()->default_value(false), "Include games that have been set hidden in account page")
("size-only", bpo::value<bool>(&Globals::globalConfig.bSizeOnly)->zero_tokens()->default_value(false), "Don't check the hashes of the files whose size matches that on the server")
; ;
options_cli_no_cfg_hidden.add_options() options_cli_no_cfg_hidden.add_options()

View File

@ -2638,7 +2638,7 @@ void Downloader::processDownloadQueue(Config conf, const unsigned int& tid)
if (conf.dlConf.bRemoteXML && !xml_url.empty()) if (conf.dlConf.bRemoteXML && !xml_url.empty())
xml = galaxy->getResponse(xml_url); xml = galaxy->getResponse(xml_url);
if (!xml.empty()) if (!xml.empty() && !Globals::globalConfig.bSizeOnly)
{ {
std::string localHash = Util::getLocalFileHash(conf.sXMLDirectory, filepath.string(), gf.gamename); std::string localHash = Util::getLocalFileHash(conf.sXMLDirectory, filepath.string(), gf.gamename);
// Do version check if local hash exists // Do version check if local hash exists