_clientList = [];
private void AutoSkipCreditChanged(object? sender, BasePluginConfiguration e)
{
@@ -54,6 +47,7 @@ public class AutoSkipCredits : IHostedService, IDisposable
var newState = configuration.AutoSkipCredits;
_logger.LogDebug("Setting playback timer enabled to {NewState}", newState);
_playbackTimer.Enabled = newState;
+ _clientList = [.. configuration.ClientList.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)];
}
private void UserDataManager_UserDataSaved(object? sender, UserDataSaveEventArgs e)
@@ -111,19 +105,8 @@ public class AutoSkipCredits : IHostedService, IDisposable
private void PlaybackTimer_Elapsed(object? sender, ElapsedEventArgs e)
{
- foreach (var session in _sessionManager.Sessions)
+ foreach (var session in _sessionManager.Sessions.Where(s => _clientList.Contains(s.Client, StringComparer.OrdinalIgnoreCase)))
{
- if (WarningManager.HasFlag(PluginWarning.UnableToAddSkipButton))
- {
- _logger.LogTrace("using autoskip to skip the credits because the injection of the skip button failed");
- }
-
- // only need for official Android TV App and jellyfin-kodi
- else if (session.Client != "Android TV" && session.Client != "Kodi")
- {
- continue;
- }
-
var deviceId = session.DeviceId;
var itemId = session.NowPlayingItem.Id;
var position = session.PlayState.PositionTicks / TimeSpan.TicksPerSecond;
diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs
index cdd6d5e..f6face2 100644
--- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs
+++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs
@@ -29,6 +29,11 @@ public class PluginConfiguration : BasePluginConfiguration
///
public string SelectedLibraries { get; set; } = string.Empty;
+ ///
+ /// Gets or sets the list of client to auto skip for.
+ ///
+ public string ClientList { get; set; } = "Android TV, Kodi";
+
///
/// Gets or sets a value indicating whether to scan for intros during a scheduled task.
///
diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html
index 12302e3..1501fbf 100644
--- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html
+++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html
@@ -398,6 +398,14 @@
+
+ Auto Skip Client List
+
+
+
+
+
+