From 384784527aa59e0f60da08f57aa45c11ed793a0a Mon Sep 17 00:00:00 2001 From: ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> Date: Sun, 19 Jun 2022 00:03:10 -0500 Subject: [PATCH] Restore per season progress updates --- CHANGELOG.md | 4 +++ .../ScheduledTasks/FingerprinterTask.cs | 26 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ebb02e..43e4f5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.1.6.0 +* Write EDL files with intro timestamps +* Restore per season status updates + ## v0.1.5.0 (2022-06-17) * Use `ffmpeg` to generate audio fingerprints instead of `fpcalc` * Requires that the installed version of `ffmpeg`: diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs index 7647fda..531ac04 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs @@ -173,14 +173,38 @@ public class FingerprinterTask : IScheduledTask return; } + var episodes = season.Value; + var unanalyzed = false; + + // Only log an analysis message if there are unanalyzed episodes in this season. + foreach (var episode in episodes) + { + if (!Plugin.Instance!.Intros.ContainsKey(episode.EpisodeId)) + { + unanalyzed = true; + break; + } + } + + if (unanalyzed) + { _logger.LogInformation( "Analyzing {Count} episodes from {Name} season {Season}", season.Value.Count, first.SeriesName, first.SeasonNumber); + } + else + { + _logger.LogDebug( + "All episodes from {Name} season {Season} have already been analyzed", + first.SeriesName, + first.SeasonNumber); + + return; + } // Ensure there are an even number of episodes - var episodes = season.Value; if (episodes.Count % 2 != 0) { episodes.Add(episodes[episodes.Count - 2]);