diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/AutoSkip.cs b/ConfusedPolarBear.Plugin.IntroSkipper/AutoSkip.cs
index 3846bb9..3da05ea 100644
--- a/ConfusedPolarBear.Plugin.IntroSkipper/AutoSkip.cs
+++ b/ConfusedPolarBear.Plugin.IntroSkipper/AutoSkip.cs
@@ -74,6 +74,8 @@ public class AutoSkip : IServerEntryPoint
private void UserDataManager_UserDataSaved(object? sender, UserDataSaveEventArgs e)
{
var itemId = e.Item.Id;
+ var newState = false;
+ var episodeNumber = e.Item.IndexNumber.GetValueOrDefault(-1);
// Ignore all events except playback start & end
if (e.SaveReason != UserDataSaveReason.PlaybackStart && e.SaveReason != UserDataSaveReason.PlaybackFinished)
@@ -106,13 +108,19 @@ public class AutoSkip : IServerEntryPoint
return;
}
+ // If this is the first episode in the season, and SkipFirstEpisode is false, pretend that we've already sent the seek command for this playback session.
+ if (!Plugin.Instance!.Configuration.SkipFirstEpisode && episodeNumber == 1)
+ {
+ newState = true;
+ }
+
// Reset the seek command state for this device.
lock (_sentSeekCommandLock)
{
var device = session.DeviceId;
_logger.LogDebug("Resetting seek command state for session {Session}", device);
- _sentSeekCommand[device] = false;
+ _sentSeekCommand[device] = newState;
}
}
diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs
index db86ce3..929feb9 100644
--- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs
+++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs
@@ -78,4 +78,9 @@ public class PluginConfiguration : BasePluginConfiguration
/// Gets or sets the seconds after the intro starts to hide the skip prompt at.
///
public int HidePromptAdjustment { get; set; } = 10;
+
+ ///
+ /// Gets or sets a value indicating whether the introduction in the first episode of a season should be skipped.
+ ///
+ public bool SkipFirstEpisode { get; set; } = true;
}
diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html
index a385500..d4f43ec 100644
--- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html
+++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html
@@ -171,6 +171,17 @@
+
+
+
+
+ If checked, auto skip will skip introductions in the first episode of a season.
+