mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Add the abillity to force upload/download of cloud saves even if up-to-date
This commit is contained in:
parent
4ff846e5cd
commit
6870330eab
@ -297,8 +297,10 @@ class Config
|
||||
Blacklist ignorelist;
|
||||
Blacklist gamehasdlc;
|
||||
|
||||
// Cloud save options
|
||||
std::vector<std::string> cloudWhiteList;
|
||||
std::vector<std::string> cloudBlackList;
|
||||
bool bCloudForce;
|
||||
|
||||
std::string sGameHasDLCList;
|
||||
|
||||
|
1
main.cpp
1
main.cpp
@ -233,6 +233,7 @@ int main(int argc, char *argv[])
|
||||
("wine-prefix", bpo::value<std::string>(&Globals::globalConfig.dirConf.sWinePrefix)->default_value("."), "Set wineprefix directory")
|
||||
("cloud-whitelist", bpo::value<std::vector<std::string>>(&Globals::globalConfig.cloudWhiteList)->multitoken(), "Include this list of cloud saves, by default all cloud saves are included\n Example: --cloud-whitelist saves/AutoSave-0 saves/AutoSave-1/screenshot.png")
|
||||
("cloud-blacklist", bpo::value<std::vector<std::string>>(&Globals::globalConfig.cloudBlackList)->multitoken(), "Exclude this list of cloud saves\n Example: --cloud-blacklist saves/AutoSave-0 saves/AutoSave-1/screenshot.png")
|
||||
("cloud-force", bpo::value<bool>(&Globals::globalConfig.bCloudForce)->zero_tokens()->default_value(false), "Download or Upload cloud saves even if they're up-to-date\nDelete remote cloud saves even if no saves are whitelisted")
|
||||
#ifdef USE_QT_GUI_LOGIN
|
||||
("enable-login-gui", bpo::value<bool>(&Globals::globalConfig.bEnableLoginGUI)->zero_tokens()->default_value(false), "Enable login GUI when encountering reCAPTCHA on login form")
|
||||
#endif
|
||||
|
@ -4798,7 +4798,7 @@ void Downloader::uploadCloudSavesById(const std::string& product_id, int build_i
|
||||
cloudSaveFile local_csf { std::move(it->second) };
|
||||
path_to_cloudSaveFile.erase(it);
|
||||
|
||||
if(csf.lastModified < local_csf.lastModified) {
|
||||
if(Globals::globalConfig.bCloudForce || csf.lastModified < local_csf.lastModified) {
|
||||
iTotalRemainingBytes.fetch_add(local_csf.fileSize);
|
||||
|
||||
dlCloudSaveQueue.push(local_csf);
|
||||
@ -4850,7 +4850,7 @@ void Downloader::downloadCloudSavesById(const std::string& product_id, int build
|
||||
// last_write_time minus a single second, since time_t is only accurate to the second unlike boost::posix_time::ptime
|
||||
auto time = boost::posix_time::from_time_t(boost::filesystem::last_write_time(filepath) - 1);
|
||||
|
||||
if(time <= csf.lastModified) {
|
||||
if(!Globals::globalConfig.bCloudForce && time <= csf.lastModified) {
|
||||
std::cout << "Already up to date -- skipping: " << csf.path << std::endl;
|
||||
return; // This file is already completed
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user