From ed9f3cbde890c12e75a74c5892d14ec1db55e1ab Mon Sep 17 00:00:00 2001 From: ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> Date: Tue, 27 Sep 2022 21:42:51 -0500 Subject: [PATCH] Add option to analyze specials Part of #67 --- CHANGELOG.md | 1 + .../Configuration/PluginConfiguration.cs | 5 +++++ .../Configuration/configPage.html | 14 ++++++-------- .../ScheduledTasks/AnalyzeEpisodesTask.cs | 12 +++++++----- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 507dabc..c214aaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * Amount played is customizable and defaults to 2 seconds * Support modifying introduction detection algorithm settings * Add option to not skip the introduction in the first episode of a season + * Add option to analyze show extras (specials) * Fixes * Fix scheduled task interval (#79) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs index 8c2238d..92b3a3e 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs @@ -31,6 +31,11 @@ public class PluginConfiguration : BasePluginConfiguration /// public string SelectedLibraries { get; set; } = string.Empty; + /// + /// Gets or sets a value indicating whether to analyze season 0. + /// + public bool AnalyzeSeasonZero { get; set; } = false; + // ===== EDL handling ===== /// diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html index d22783a..57f5a69 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html @@ -16,14 +16,12 @@
- If checked, will store the audio fingerprints for all subsequently scanned files to - disk. Caching fingerprints avoids having to re-run ffmpeg on each file, at the expense - of disk usage. + Analyze show extras (specials).
@@ -203,8 +201,8 @@
- If checked, intros will be automatically skipped. Will only work if web - sockets are configured correctly.
+ If checked, intros will be automatically skipped. If you access Jellyfin through a reverse proxy, it must be configured to proxy web + sockets.
@@ -400,7 +398,7 @@ ] var booleanConfigurationFields = [ - "CacheFingerprints", + "AnalyzeSeasonZero", "RegenerateEdlFiles", "AutoSkip", "SkipFirstEpisode" diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/AnalyzeEpisodesTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/AnalyzeEpisodesTask.cs index 375b1f5..0806788 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/AnalyzeEpisodesTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/AnalyzeEpisodesTask.cs @@ -235,16 +235,18 @@ public class AnalyzeEpisodesTask : IScheduledTask // Episode analysis queue. var episodeAnalysisQueue = new List(episodes); - /* Don't analyze specials or seasons with an insufficient number of episodes. - * A season with only 1 episode can't be analyzed as it would compare the episode to itself, - * which would result in the entire episode being marked as an introduction, as the audio is identical. - */ - if (episodes.Count < 2 || episodes[0].SeasonNumber == 0) + // Skip seasons with an insufficient number of episodes. + if (episodes.Count <= 1) { return episodes.Count; } + // Only analyze specials (season 0) if the user has opted in. var first = episodes[0]; + if (first.SeasonNumber == 0 && !Plugin.Instance!.Configuration.AnalyzeSeasonZero) + { + return 0; + } _logger.LogInformation( "Analyzing {Count} episodes from {Name} season {Season}",