diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs index 6fb7e49..72b4917 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs @@ -19,6 +19,11 @@ public class PluginConfiguration : BasePluginConfiguration /// public bool CacheFingerprints { get; set; } = true; + /// + /// Gets or sets the max degree of parallelism used when analyzing episodes. + /// + public int MaxParallelism { get; set; } = 2; + /// /// Gets or sets a value indicating whether introductions should be automatically skipped. /// diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html index 7e00e3b..0381ca2 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html @@ -12,47 +12,69 @@
-
- +
+ Analysis -
- If checked, intros will be automatically skipped. Will only work if web - sockets are configured correctly.
- Jellyfin must be restarted after changing this setting. +
+ + +
+ If checked, will store the audio fingerprints for all subsequently scanned files to + disk. Caching fingerprints avoids having to re-run fpcalc on each file, at the expense + of disk usage. +
-
-
- - -
- If checked, will store the fingerprints for all subsequently scanned files to disk. - Caching fingerprints avoids having to re-run fpcalc on each file, at the expense of disk - usage. +
+ + +
+ Maximum degree of parallelism to use when analyzing episodes. +
-
+
-
- - -
- Seconds before the introduction starts to display the skip prompt at. -
-
+
+ Playback -
- - -
- Seconds after the introduction starts to hide the skip prompt at. +
+ + +
+ If checked, intros will be automatically skipped. Will only work if web + sockets are configured correctly.
+ Jellyfin must be restarted after changing this setting. +
-
+ +
+ + +
+ Seconds before the introduction starts to display the skip prompt at. +
+
+ +
+ + +
+ Seconds after the introduction starts to hide the skip prompt at. +
+
+
@@ -415,8 +438,9 @@ Dashboard.showLoadingMsg(); ApiClient.getPluginConfiguration("c83d86bb-a1e0-4c35-a113-e2101cf4ee6b").then(function (config) { document.querySelector('#AutoSkip').checked = config.AutoSkip; - document.querySelector('#CacheFingerprints').checked = config.CacheFingerprints; + document.querySelector('#MaxParallelism').value = config.MaxParallelism; + document.querySelector('#CacheFingerprints').checked = config.CacheFingerprints; document.querySelector('#ShowPromptAdjustment').value = config.ShowPromptAdjustment; document.querySelector('#HidePromptAdjustment').value = config.HidePromptAdjustment; @@ -429,8 +453,9 @@ Dashboard.showLoadingMsg(); ApiClient.getPluginConfiguration("c83d86bb-a1e0-4c35-a113-e2101cf4ee6b").then(function (config) { config.AutoSkip = document.querySelector('#AutoSkip').checked; - config.CacheFingerprints = document.querySelector('#CacheFingerprints').checked; + config.MaxParallelism = document.querySelector('#MaxParallelism').value; + config.CacheFingerprints = document.querySelector('#CacheFingerprints').checked; config.ShowPromptAdjustment = document.querySelector("#ShowPromptAdjustment").value; config.HidePromptAdjustment = document.querySelector("#HidePromptAdjustment").value; diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs index 3a15cc1..fc198f5 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs @@ -110,10 +110,10 @@ public class FingerprinterTask : IScheduledTask } var totalProcessed = 0; - - // TODO: make configurable - var options = new ParallelOptions(); - options.MaxDegreeOfParallelism = 2; + var options = new ParallelOptions() + { + MaxDegreeOfParallelism = Plugin.Instance!.Configuration.MaxParallelism + }; Parallel.ForEach(queue, options, (season) => { @@ -199,7 +199,6 @@ public class FingerprinterTask : IScheduledTask var lhs = episodes[i]; var rhs = episodes[i + 1]; - // TODO: make configurable if (!everFoundIntro && failures >= 20) { _logger.LogWarning(