From a07111d5e18b7d5591a3e3253d8f0e3bef2dbc19 Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Tue, 16 Apr 2024 14:01:48 -0400 Subject: [PATCH] Clear restrictions when overriding auto --- ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs | 6 +++--- .../ScheduledTasks/DetectCreditsTask.cs | 2 ++ .../ScheduledTasks/DetectIntrosCreditsTask.cs | 2 ++ .../ScheduledTasks/DetectIntrosTask.cs | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs index 0ed7ea1..d9c0d74 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs @@ -207,10 +207,10 @@ public class Entrypoint : IHostedService, IDisposable return; } - if (Plugin.Instance!.AnalyzerTaskIsRunning && AutomaticTaskState == TaskState.Running) + // Unless user initiated, this is likely an overlap + if (Entrypoint.AutomaticTaskState == TaskState.Running) { - _logger.LogInformation("{0} Automatic Task will be superseded by library scan.", AutomaticTaskState); - CancelAutomaticTask(); + return; } StartTimer(); diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectCreditsTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectCreditsTask.cs index 2f43939..c2d71c7 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectCreditsTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectCreditsTask.cs @@ -86,6 +86,8 @@ public class DetectCreditsTask : IScheduledTask _logger.LogInformation("Scheduled Task is starting"); + Plugin.Instance!.Configuration.PathRestrictions.Clear(); + var baseCreditAnalyzer = new BaseItemAnalyzerTask( AnalysisMode.Credits, _loggerFactory.CreateLogger(), diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectIntrosCreditsTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectIntrosCreditsTask.cs index 2b465c5..925d5c0 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectIntrosCreditsTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectIntrosCreditsTask.cs @@ -85,6 +85,8 @@ public class DetectIntrosCreditsTask : IScheduledTask _logger.LogInformation("Scheduled Task is starting"); + Plugin.Instance!.Configuration.PathRestrictions.Clear(); + var baseIntroAnalyzer = new BaseItemAnalyzerTask( AnalysisMode.Introduction, _loggerFactory.CreateLogger(), diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectIntrosTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectIntrosTask.cs index c1f4f57..d6afc35 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectIntrosTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/DetectIntrosTask.cs @@ -85,6 +85,8 @@ public class DetectIntrosTask : IScheduledTask _logger.LogInformation("Scheduled Task is starting"); + Plugin.Instance!.Configuration.PathRestrictions.Clear(); + var baseIntroAnalyzer = new BaseItemAnalyzerTask( AnalysisMode.Introduction, _loggerFactory.CreateLogger(),