Still cancel automation for scheduled

The priority should starts at scheduled task (a full scan), but automatic scans will add items to them. Library scan is next, but again it should allow appending. Item scans should be last and get overridden by the other two.
This commit is contained in:
TwistedUmbrellaX 2024-04-14 10:20:18 -04:00
parent 3096f3fe6a
commit de60fd236f
3 changed files with 15 additions and 0 deletions

View File

@ -74,6 +74,11 @@ public class DetectCreditsTask : IScheduledTask
{
return Task.CompletedTask;
}
else if (Plugin.Instance!.AnalyzerTaskIsRunning && Entrypoint.AutomaticTaskState == TaskState.Running)
{
_logger.LogInformation("Automatic Task is {0} and will be canceled.", Entrypoint.AutomaticTaskState);
Entrypoint.CancelAutomaticTask();
}
_logger.LogInformation("Scheduled Task is starting");
Plugin.Instance!.AnalyzerTaskIsRunning = true;

View File

@ -73,6 +73,11 @@ public class DetectIntrosCreditsTask : IScheduledTask
{
return Task.CompletedTask;
}
else if (Plugin.Instance!.AnalyzerTaskIsRunning && Entrypoint.AutomaticTaskState == TaskState.Running)
{
_logger.LogInformation("Automatic Task is {0} and will be canceled.", Entrypoint.AutomaticTaskState);
Entrypoint.CancelAutomaticTask();
}
_logger.LogInformation("Scheduled Task is starting");
Plugin.Instance!.AnalyzerTaskIsRunning = true;

View File

@ -73,6 +73,11 @@ public class DetectIntrosTask : IScheduledTask
{
return Task.CompletedTask;
}
else if (Plugin.Instance!.AnalyzerTaskIsRunning && Entrypoint.AutomaticTaskState == TaskState.Running)
{
_logger.LogInformation("Automatic Task is {0} and will be canceled.", Entrypoint.AutomaticTaskState);
Entrypoint.CancelAutomaticTask();
}
_logger.LogInformation("Scheduled Task is starting");
Plugin.Instance!.AnalyzerTaskIsRunning = true;