Add status code for file size mismatch

This commit is contained in:
Sude 2015-07-02 03:01:21 +03:00
parent 84e8ab8dab
commit 64690d0368
2 changed files with 5 additions and 3 deletions

View File

@ -143,7 +143,7 @@ int main(int argc, char *argv[])
("create-xml", bpo::value<std::string>(&config.sXMLFile)->default_value(""), "Create GOG XML for file\n\"automatic\" to enable automatic XML creation")
("update-check", bpo::value<bool>(&config.bUpdateCheck)->zero_tokens()->default_value(false), "Check for update notifications")
("check-orphans", bpo::value<std::string>(&config.sOrphanRegex)->implicit_value(""), check_orphans_text.c_str())
("status", bpo::value<bool>(&config.bCheckStatus)->zero_tokens()->default_value(false), "Show status of files\n\nOutput format:\nstatuscode gamename filename filesize filehash\n\nStatus codes:\nOK - File is OK\nND - File is not downloaded\nMD5 - MD5 mismatch, different version")
("status", bpo::value<bool>(&config.bCheckStatus)->zero_tokens()->default_value(false), "Show status of files\n\nOutput format:\nstatuscode gamename filename filesize filehash\n\nStatus codes:\nOK - File is OK\nND - File is not downloaded\nMD5 - MD5 mismatch, different version\nFS - File size mismatch, incomplete download")
("save-config", bpo::value<bool>(&config.bSaveConfig)->zero_tokens()->default_value(false), "Create config file with current settings")
("reset-config", bpo::value<bool>(&config.bResetConfig)->zero_tokens()->default_value(false), "Reset config settings to default")
("report", bpo::value<std::string>(&config.sReportFilePath)->implicit_value("lgogdownloader-report.log"), "Save report of downloaded/repaired files to specified file\nDefault filename: lgogdownloader-report.log")

View File

@ -2631,8 +2631,9 @@ void Downloader::checkStatus()
if (filesize_xml > 0 && filesize_xml != filesize)
{
bHashOK = false;
localHash = Util::getFileHash(path.string(), RHASH_MD5);
std::cout << "FS " << games[i].gamename << " " << filepath.filename().string() << " " << filesize << " " << localHash << std::endl;
continue;
}
}
@ -2759,8 +2760,9 @@ void Downloader::checkStatus()
if (filesize_xml > 0 && filesize_xml != filesize)
{
bHashOK = false;
localHash = Util::getFileHash(path.string(), RHASH_MD5);
std::cout << "FS " << games[i].gamename << " " << filepath.filename().string() << " " << filesize << " " << localHash << std::endl;
continue;
}
}