diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs index 763d461..1474d74 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Analyzers/ChapterAnalyzer.cs @@ -149,12 +149,21 @@ 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) + { + continue; + } + matchingChapter = new(episode.EpisodeId, currentRange); _logger.LogTrace("{Base}: okay", baseMessage); - if (i > 0) - { - break; - } + break; } return matchingChapter; diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs index 0d4407e..76e5896 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs @@ -17,11 +17,6 @@ public class PluginConfiguration : BasePluginConfiguration // ===== Analysis settings ===== - /// - /// Gets or sets a value indicating whether the episode's fingerprint should be cached to the filesystem. - /// - public bool CacheFingerprints { get; set; } = true; - /// /// Gets or sets the max degree of parallelism used when analyzing episodes. /// @@ -37,6 +32,16 @@ public class PluginConfiguration : BasePluginConfiguration /// public bool AnalyzeSeasonZero { get; set; } = false; + /// + /// Gets or sets a value indicating whether the episode's fingerprint should be cached to the filesystem. + /// + public bool CacheFingerprints { get; set; } = true; + + /// + /// Gets or sets a value indicating whether analysis will use Chromaprint to determine fingerprints. + /// + public bool UseChromaprint { get; set; } = true; + // ===== EDL handling ===== /// diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html index 9ae2000..0d7b8b9 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html @@ -213,6 +213,20 @@ Process Configuration
+
+ + +
+ If checked, analysis will use Chromaprint to compare episode audio and identify intros. +
+ WARNING: Disabling this option may result in incomplete or innaccurate analysis! +
+
+
+