Implemented the RescanRequired

This commit is contained in:
Serraniel 2018-02-01 21:16:23 +01:00
parent 4d6cc85732
commit b022306cfd

View file

@ -186,42 +186,6 @@ namespace DML.Application.Classes
} }
} }
/*while ((Client.LoginState != LoginState.LoggedIn || Client.ConnectionState!=ConnectionState.Connected) && !abort)
{
Logger.Debug(Client.ConnectionState.ToString());
Logger.Debug(Client.LoginState.ToString());
Logger.Trace("Entering login loop.");
try
{
if (Client.ConnectionState == ConnectionState.Connecting)
continue;
if (!string.IsNullOrEmpty(Settings.LoginToken))
{
Logger.Debug("Trying to login with last known token...");
await Client.LoginAsync(TokenType.User, Settings.LoginToken);
await Client.StartAsync();
await Task.Delay(1000);
}
}
catch (HttpException ex)
{
Logger.Warn($"Login seems to have failed or gone wrong: {ex.GetType().Name} - {ex.Message}");
}
if (Client.LoginState == LoginState.LoggedOut)
{
Settings.Password = string.Empty;
Logger.Debug("Showing dialog for username and password...");
var loginDlg = new LoginDialog();
loginDlg.ShowDialog();
Logger.Trace("Dialog closed.");
}
}*/
Logger.Debug("Start checking for invalid jobs..."); Logger.Debug("Start checking for invalid jobs...");
//Client //Client
@ -255,8 +219,14 @@ namespace DML.Application.Classes
job.Stop(); job.Stop();
job.Delete(); job.Delete();
} }
if (Settings.RescanRequired)
job.KnownTimestamp = 0;
} }
Settings.RescanRequired = false;
Settings.Store();
splash.Close(); splash.Close();
Logger.Info("Starting scheduler..."); Logger.Info("Starting scheduler...");