Skip to content

Commit 1caa784

Browse files
committed
Login is smarter now
1 parent a433cc6 commit 1caa784

6 files changed

Lines changed: 12 additions & 10 deletions

File tree

RedumpTool/Features/PacksFeature.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ public override bool Execute()
6565
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
6666

6767
// Login to Redump, if necessary
68-
if (!_client.LoggedIn)
69-
_client.Login(username, password).Wait();
68+
_client.Login(username, password).Wait();
7069

7170
// Start the processing
7271
var processingTask = _client.DownloadPacks(outDir, useSubfolders);

RedumpTool/Features/QueryFeature.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ public override bool Execute()
8989
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
9090

9191
// Login to Redump, if necessary
92-
if (!_client.LoggedIn)
93-
_client.Login(username, password).Wait();
92+
_client.Login(username, password).Wait();
9493

9594
// Start the processing
9695
Task<List<int>> processingTask;

RedumpTool/Features/SiteFeature.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ public override bool Execute()
8989
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
9090

9191
// Login to Redump, if necessary
92-
if (!_client.LoggedIn)
93-
_client.Login(username, password).Wait();
92+
_client.Login(username, password).Wait();
9493

9594
// Start the processing
9695
Task<List<int>> processingTask;

RedumpTool/Features/UserFeature.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ public override bool Execute()
7272
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
7373

7474
// Login to Redump, if necessary
75-
if (!_client.LoggedIn)
76-
_client.Login(username, password).Wait();
75+
_client.Login(username, password).Wait();
7776

7877
// Start the processing
7978
Task<List<int>> processingTask;

RedumpTool/Features/WIPFeature.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ public override bool Execute()
8484
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
8585

8686
// Login to Redump, if necessary
87-
if (!_client.LoggedIn)
88-
_client.Login(username, password).Wait();
87+
_client.Login(username, password).Wait();
8988

9089
// Start the processing
9190
Task<List<int>> processingTask;

SabreTools.RedumpLib/Web/RedumpClient.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ public RedumpClient()
116116
/// <returns>True if the user could be logged in, false otherwise, null on error</returns>
117117
public async Task<bool?> Login(string username, string password)
118118
{
119+
// Check for already logged in
120+
if (LoggedIn)
121+
{
122+
Console.WriteLine("Already logged in!");
123+
return true;
124+
}
125+
119126
// Credentials verification
120127
if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
121128
{

0 commit comments

Comments
 (0)