From 75688772b18f84f2c9e4f7fa145987a7546b3d0d Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Sun, 14 Apr 2024 10:49:28 -0400 Subject: [PATCH] Only shared should split progress bar --- ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs | 2 +- .../ScheduledTasks/BaseItemAnalyzerTask.cs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs index faf14aa..245cc8e 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs @@ -300,8 +300,8 @@ public class Entrypoint : IServerEntryPoint } } - Plugin.Instance!.AnalyzerTaskIsRunning = false; Plugin.Instance!.Configuration.PathRestrictions.Clear(); + Plugin.Instance!.AnalyzerTaskIsRunning = false; _autoTaskCompletEvent.Set(); // New item detected, start timer again diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs index f80f0a4..3eabd6d 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs @@ -146,13 +146,20 @@ public class BaseItemAnalyzerTask EdlManager.UpdateEDLFiles(episodes); } - if (_analysisMode == AnalysisMode.Introduction) + if (_logger is ILogger) { - progress.Report(((totalProcessed * 100) / totalQueued) / 2); + if (_analysisMode == AnalysisMode.Introduction) + { + progress.Report(((totalProcessed * 100) / totalQueued) / 2); + } + else + { + progress.Report((((totalProcessed * 100) / totalQueued) / 2) + 50); + } } else { - progress.Report((((totalProcessed * 100) / totalQueued) / 2) + 50); + progress.Report((totalProcessed * 100) / totalQueued); } });