mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Don't change globalConfig.bLogin value in Downloader::isLoggedIn
This commit is contained in:
parent
36181afb4d
commit
04592d512a
4
main.cpp
4
main.cpp
@ -597,11 +597,13 @@ int main(int argc, char *argv[])
|
|||||||
int iLoginTries = 0;
|
int iLoginTries = 0;
|
||||||
bool bLoginOK = false;
|
bool bLoginOK = false;
|
||||||
|
|
||||||
// Login because --login, --login-api or --login-website was used
|
// Login because --login was used
|
||||||
if (Globals::globalConfig.bLogin)
|
if (Globals::globalConfig.bLogin)
|
||||||
bLoginOK = downloader.login();
|
bLoginOK = downloader.login();
|
||||||
|
|
||||||
bool bIsLoggedin = downloader.isLoggedIn();
|
bool bIsLoggedin = downloader.isLoggedIn();
|
||||||
|
if (!bIsLoggedin)
|
||||||
|
Globals::globalConfig.bLogin = true;
|
||||||
|
|
||||||
// Login because we are not logged in
|
// Login because we are not logged in
|
||||||
while (iLoginTries++ < Globals::globalConfig.iRetries && !bIsLoggedin)
|
while (iLoginTries++ < Globals::globalConfig.iRetries && !bIsLoggedin)
|
||||||
|
@ -133,19 +133,13 @@ Downloader::~Downloader()
|
|||||||
bool Downloader::isLoggedIn()
|
bool Downloader::isLoggedIn()
|
||||||
{
|
{
|
||||||
bool bIsLoggedIn = false;
|
bool bIsLoggedIn = false;
|
||||||
Globals::globalConfig.bLogin= false;
|
|
||||||
|
|
||||||
bool bWebsiteIsLoggedIn = gogWebsite->IsLoggedIn();
|
bool bWebsiteIsLoggedIn = gogWebsite->IsLoggedIn();
|
||||||
if (!bWebsiteIsLoggedIn)
|
|
||||||
Globals::globalConfig.bLogin = true;
|
|
||||||
|
|
||||||
bool bGalaxyIsLoggedIn = !gogGalaxy->isTokenExpired();
|
bool bGalaxyIsLoggedIn = !gogGalaxy->isTokenExpired();
|
||||||
|
|
||||||
if (!bGalaxyIsLoggedIn)
|
if (!bGalaxyIsLoggedIn)
|
||||||
{
|
{
|
||||||
if (gogGalaxy->refreshLogin())
|
if (gogGalaxy->refreshLogin())
|
||||||
bGalaxyIsLoggedIn = true;
|
bGalaxyIsLoggedIn = true;
|
||||||
else
|
|
||||||
Globals::globalConfig.bLogin = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bWebsiteIsLoggedIn && bGalaxyIsLoggedIn)
|
if (bWebsiteIsLoggedIn && bGalaxyIsLoggedIn)
|
||||||
|
Loading…
Reference in New Issue
Block a user