From 85f21ae51c9182cbf78c41138ce2d2d585cf9da2 Mon Sep 17 00:00:00 2001 From: ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> Date: Sat, 3 Sep 2022 01:42:31 -0500 Subject: [PATCH] Check silence start time before adjusting intro --- .../ScheduledTasks/AnalyzeEpisodesTask.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/AnalyzeEpisodesTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/AnalyzeEpisodesTask.cs index 328e7b8..c4f39c8 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/AnalyzeEpisodesTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/AnalyzeEpisodesTask.cs @@ -652,10 +652,12 @@ public class AnalyzeEpisodesTask : IScheduledTask // Ignore any silence that: // * doesn't intersect the ending of the intro, or - // * is shorter than the user defined minimum duration + // * is shorter than the user defined minimum duration, or + // * starts before the introduction does if ( !originalIntroEnd.Intersects(currentRange) || - currentRange.Duration < silenceDetectionMinimumDuration) + currentRange.Duration < silenceDetectionMinimumDuration || + currentRange.Start < originalIntro.IntroStart) { continue; }