From 46d446718f828f2158859924720d1ca3d111f300 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 | 7 +++++++ .../ScheduledTasks/DetectCreditsTask.cs | 2 ++ .../ScheduledTasks/DetectIntrosCreditsTask.cs | 2 ++ .../ScheduledTasks/DetectIntrosTask.cs | 2 ++ 4 files changed, 13 insertions(+) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs index 35271c4..6b5b501 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs @@ -206,6 +206,12 @@ public class Entrypoint : IServerEntryPoint return; } + // Unless user initiated, this is likely an overlap + if (Entrypoint.AutomaticTaskState == TaskState.Running) + { + return; + } + StartTimer(); } @@ -341,6 +347,7 @@ public class Entrypoint : IServerEntryPoint { if (!dispose) { + Plugin.Instance!.Configuration.PathRestrictions.Clear(); _libraryManager.ItemAdded -= OnItemAdded; _libraryManager.ItemUpdated -= OnItemModified; _taskManager.TaskCompleted -= OnLibraryRefresh; 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(),