From 33c2cce6fd61c235020913d5c5b082dd371aa0d0 Mon Sep 17 00:00:00 2001 From: rlauu <46294892+rlauu@users.noreply.github.com> Date: Fri, 19 Apr 2024 17:59:23 +0200 Subject: [PATCH] fix progress bar --- .../ScheduledTasks/BaseItemAnalyzerTask.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs index 9161383..e1887fa 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs @@ -74,6 +74,8 @@ public class BaseItemAnalyzerTask totalQueued += kvp.Value.Count; } + totalQueued *= _analysisModes.Count; + if (totalQueued == 0) { throw new FingerprintException( @@ -131,6 +133,8 @@ public class BaseItemAnalyzerTask Interlocked.Add(ref totalProcessed, analyzed); writeEdl = analyzed > 0 || Plugin.Instance!.Configuration.RegenerateEdlFiles; + + progress.Report((totalProcessed * 100) / totalQueued); } } catch (FingerprintException ex) @@ -146,8 +150,6 @@ public class BaseItemAnalyzerTask { EdlManager.UpdateEDLFiles(episodes); } - - progress.Report((totalProcessed * 100) / totalQueued); }); if (Plugin.Instance!.Configuration.RegenerateEdlFiles)