mirror of
https://github.com/SabreTools/SabreTools.RedumpLib.git
synced 2026-09-22 23:14:52 +00:00
Login is smarter now
This commit is contained in:
@@ -65,8 +65,7 @@ namespace RedumpTool.Features
|
||||
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
|
||||
|
||||
// Login to Redump, if necessary
|
||||
if (!_client.LoggedIn)
|
||||
_client.Login(username, password).Wait();
|
||||
_client.Login(username, password).Wait();
|
||||
|
||||
// Start the processing
|
||||
var processingTask = _client.DownloadPacks(outDir, useSubfolders);
|
||||
|
||||
@@ -89,8 +89,7 @@ namespace RedumpTool.Features
|
||||
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
|
||||
|
||||
// Login to Redump, if necessary
|
||||
if (!_client.LoggedIn)
|
||||
_client.Login(username, password).Wait();
|
||||
_client.Login(username, password).Wait();
|
||||
|
||||
// Start the processing
|
||||
Task<List<int>> processingTask;
|
||||
|
||||
@@ -89,8 +89,7 @@ namespace RedumpTool.Features
|
||||
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
|
||||
|
||||
// Login to Redump, if necessary
|
||||
if (!_client.LoggedIn)
|
||||
_client.Login(username, password).Wait();
|
||||
_client.Login(username, password).Wait();
|
||||
|
||||
// Start the processing
|
||||
Task<List<int>> processingTask;
|
||||
|
||||
@@ -72,8 +72,7 @@ namespace RedumpTool.Features
|
||||
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
|
||||
|
||||
// Login to Redump, if necessary
|
||||
if (!_client.LoggedIn)
|
||||
_client.Login(username, password).Wait();
|
||||
_client.Login(username, password).Wait();
|
||||
|
||||
// Start the processing
|
||||
Task<List<int>> processingTask;
|
||||
|
||||
@@ -84,8 +84,7 @@ namespace RedumpTool.Features
|
||||
_client.Timeout = TimeSpan.FromSeconds(timeout.Value);
|
||||
|
||||
// Login to Redump, if necessary
|
||||
if (!_client.LoggedIn)
|
||||
_client.Login(username, password).Wait();
|
||||
_client.Login(username, password).Wait();
|
||||
|
||||
// Start the processing
|
||||
Task<List<int>> processingTask;
|
||||
|
||||
@@ -116,6 +116,13 @@ namespace SabreTools.RedumpLib.Web
|
||||
/// <returns>True if the user could be logged in, false otherwise, null on error</returns>
|
||||
public async Task<bool?> Login(string username, string password)
|
||||
{
|
||||
// Check for already logged in
|
||||
if (LoggedIn)
|
||||
{
|
||||
Console.WriteLine("Already logged in!");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Credentials verification
|
||||
if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user