mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Fix saving config when init fails but --login was not used
This commit is contained in:
parent
92b8ef3750
commit
31c547be8a
@ -44,6 +44,7 @@ class Downloader
|
||||
Downloader(Config &conf);
|
||||
virtual ~Downloader();
|
||||
int init();
|
||||
int login();
|
||||
void listGames();
|
||||
void updateCheck();
|
||||
void repair();
|
||||
@ -59,7 +60,6 @@ class Downloader
|
||||
CURLcode downloadFile(const std::string& url, const std::string& filepath, const std::string& xml_data = std::string(), const std::string& gamename = std::string());
|
||||
int repairFile(const std::string& url, const std::string& filepath, const std::string& xml_data = std::string(), const std::string& gamename = std::string());
|
||||
int downloadCovers(const std::string& gamename, const std::string& directory, const std::string& cover_xml_data);
|
||||
int login();
|
||||
int getGameDetails();
|
||||
void getGameList();
|
||||
size_t getResumePosition();
|
||||
|
6
main.cpp
6
main.cpp
@ -291,12 +291,12 @@ int main(int argc, char *argv[])
|
||||
config.sDirectory += "/";
|
||||
|
||||
Downloader downloader(config);
|
||||
int result = downloader.init();
|
||||
int initResult = downloader.init();
|
||||
|
||||
int iLoginResult = 0;
|
||||
if (config.bLogin)
|
||||
if (config.bLogin || initResult == 1)
|
||||
{
|
||||
iLoginResult = result;
|
||||
iLoginResult = downloader.login();
|
||||
if (iLoginResult == 0)
|
||||
return 1;
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ int Downloader::init()
|
||||
progressbar = new ProgressBar(config.bUnicode, config.bColor);
|
||||
|
||||
bool bInitOK = gogAPI->init(); // Initialize the API
|
||||
if (config.bLogin || !bInitOK)
|
||||
return this->login();
|
||||
if (!bInitOK)
|
||||
return 1;
|
||||
|
||||
if (config.bCover && config.bDownload && !config.bUpdateCheck)
|
||||
coverXML = this->getResponse("https://sites.google.com/site/gogdownloader/covers.xml");
|
||||
|
Loading…
x
Reference in New Issue
Block a user