From 7e2f1b56d5442d97af7b0a25fb66a72eeeea6b61 Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Wed, 6 Mar 2024 08:56:19 -0500 Subject: [PATCH] Only check next chapter is possible --- .gitignore | 1 - .../Analyzers/ChapterAnalyzer.cs | 21 +++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 6908286..bc18978 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,3 @@ docker/dist # Visual Studio .vs/ -UpgradeLog*.htm diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs index 1474d74..0b146a7 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs @@ -149,16 +149,19 @@ public class ChapterAnalyzer : IMediaFileAnalyzer continue; } - // Check for possibility of overlapping keywords - var overlap = Regex.IsMatch( - next.Name, - expression, - RegexOptions.None, - TimeSpan.FromSeconds(1)); - - if (overlap) + if (!string.IsNullOrWhiteSpace(next.Name)) { - continue; + // Check for possibility of overlapping keywords + var overlap = Regex.IsMatch( + next.Name, + expression, + RegexOptions.None, + TimeSpan.FromSeconds(1)); + + if (overlap) + { + continue; + } } matchingChapter = new(episode.EpisodeId, currentRange);