diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs index d5d09bc..1987ea9 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs @@ -91,7 +91,9 @@ public class ChapterAnalyzer : IMediaFileAnalyzer var config = Plugin.Instance?.Configuration ?? new Configuration.PluginConfiguration(); - var minDuration = config.MinimumIntroDuration; + var minDuration = mode == AnalysisMode.Introduction ? + config.MinimumIntroDuration : + config.MinimumCreditsDuration; int maxDuration = mode == AnalysisMode.Introduction ? config.MaximumIntroDuration : config.MaximumCreditsDuration; diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs index 73e3bbc..c0cbbb1 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs @@ -98,6 +98,20 @@ public class BaseItemAnalyzerTask { var writeEdl = false; + var totalRemaining = (Plugin.Instance!.TotalQueued * modeCount) - totalProcessed; + + if (totalRemaining >= queue.Count * modeCount) + { + queue = new(Plugin.Instance!.QueuedMediaItems); + totalQueued = 0; + foreach (var kvp in queue) + { + totalQueued += kvp.Value.Count; + } + + totalQueued *= _analysisModes.Count; + } + // Since the first run of the task can run for multiple hours, ensure that none // of the current media items were deleted from Jellyfin since the task was started. var (episodes, requiredModes) = queueManager.VerifyQueue(