diff --git a/Jellyscrub.sln b/Jellyscrub.sln index 39d070b..f3b6a85 100644 --- a/Jellyscrub.sln +++ b/Jellyscrub.sln @@ -8,9 +8,9 @@ EndProject Project("{911E67C6-3D85-4FCE-B560-20A9C3E3FF48}") = "jellyfin", "..\..\..\Desktop\jellyfin_10.8.1\jellyfin_10.8.1\jellyfin.exe", "{3C3B31F4-F1D8-4C10-A142-066D2033783E}" ProjectSection(DebuggerProjectSystem) = preProject PortSupplier = 00000000-0000-0000-0000-000000000000 - Executable = C:\Users\Nick\Desktop\jellyfin_10.8.1\jellyfin_10.8.1\jellyfin.exe + Executable = C:\Users\Nick\Desktop\jellyfin_10.8.7\jellyfin.exe RemoteMachine = DESKTOP-IV35NHD - StartingDirectory = C:\Users\Nick\Desktop\jellyfin_10.8.1\jellyfin_10.8.1 + StartingDirectory = C:\Users\Nick\Desktop\jellyfin_10.8.7 Environment = Default LaunchingEngine = 00000000-0000-0000-0000-000000000000 UseLegacyDebugEngines = No diff --git a/Nick.Plugin.Jellyscrub/Api/trickplay.js b/Nick.Plugin.Jellyscrub/Api/trickplay.js index da4a5db..51afcc4 100644 --- a/Nick.Plugin.Jellyscrub/Api/trickplay.js +++ b/Nick.Plugin.Jellyscrub/Api/trickplay.js @@ -63,7 +63,7 @@ if (STYLE_TRICKPLAY_CONTAINER) { jellyscrubStyle.id = 'jellscrubStyle'; jellyscrubStyle.textContent += '.chapterThumbContainer {width: 15vw; overflow: hidden;}'; jellyscrubStyle.textContent += '.chapterThumb {width: 100%; display: block; height: unset; min-height: unset; min-width: unset;}'; - jellyscrubStyle.textContent += '.chapterThumbTextContainer {position: relative; background: rgb(38, 38, 38);}'; + jellyscrubStyle.textContent += '.chapterThumbTextContainer {position: relative; background: rgb(38, 38, 38); text-align: center;}'; jellyscrubStyle.textContent += '.chapterThumbText {margin: 0; opacity: unset; padding: unset;}'; document.body.appendChild(jellyscrubStyle); } diff --git a/Nick.Plugin.Jellyscrub/Configuration/PluginConfiguration.cs b/Nick.Plugin.Jellyscrub/Configuration/PluginConfiguration.cs index a971d00..6cdea31 100644 --- a/Nick.Plugin.Jellyscrub/Configuration/PluginConfiguration.cs +++ b/Nick.Plugin.Jellyscrub/Configuration/PluginConfiguration.cs @@ -34,6 +34,12 @@ public PluginConfiguration() {} /// public MetadataScanBehavior ScanBehavior { get; set; } = MetadataScanBehavior.NonBlocking; + /// + /// The process priority of the ffmpeg .bif generation process. + /// default = BelowNormal + /// + public ProcessPriorityClass ProcessPriority { get; set; } = ProcessPriorityClass.BelowNormal; + /// /// Whether to save BIFs in the same media folder as their corresponding video. /// default = false diff --git a/Nick.Plugin.Jellyscrub/Configuration/configPage.html b/Nick.Plugin.Jellyscrub/Configuration/configPage.html index 2f27b23..6f914d4 100644 --- a/Nick.Plugin.Jellyscrub/Configuration/configPage.html +++ b/Nick.Plugin.Jellyscrub/Configuration/configPage.html @@ -79,6 +79,20 @@
Note: Do not include spaces after commas.
+
+ +
Setting this lower or higher will determine how the CPU prioritizes the ffmpeg .bif generation process in relation to other processes.
+
If you notice slowdown while generating BIFs but don't want to fully stop their generation, try lowering this as well as the thread count.
+ +
+
The number of threads to pass to the "-threads" argument of ffmpeg.
@@ -139,6 +153,7 @@ // page.querySelector('#chkStyleTrickplayContainer').checked = config.StyleTrickplayContainer; page.querySelector('#intervalInput').value = config.Interval; page.querySelector('#resolutionInput').value = fromIntArray(config.WidthResolutions); + page.querySelector('#processPriority').value = config.ProcessPriority; page.querySelector('#processThreads').value = config.ProcessThreads; Dashboard.hideLoadingMsg(); @@ -161,6 +176,7 @@ // config.StyleTrickplayContainer = page.querySelector('#chkStyleTrickplayContainer').checked; config.Interval = Math.max(0, form.querySelector('#intervalInput').value); config.WidthResolutions = toIntArray(form.querySelector('#resolutionInput').value); + config.ProcessPriority = form.querySelector('#processPriority').value; config.ProcessThreads = form.querySelector('#processThreads').value; ApiClient.updatePluginConfiguration(pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult); diff --git a/Nick.Plugin.Jellyscrub/Drawing/OldMediaEncoder.cs b/Nick.Plugin.Jellyscrub/Drawing/OldMediaEncoder.cs index 1127c7c..e1cb5b3 100644 --- a/Nick.Plugin.Jellyscrub/Drawing/OldMediaEncoder.cs +++ b/Nick.Plugin.Jellyscrub/Drawing/OldMediaEncoder.cs @@ -175,6 +175,15 @@ public async Task ExtractVideoImagesOnInterval( private void StartProcess(ProcessWrapper process) { process.Process.Start(); + try + { + _logger.LogInformation("Setting generation process priority to {0}", _config.ProcessPriority); + process.Process.PriorityClass = _config.ProcessPriority; + } + catch (Exception e) + { + _logger.LogError("Unable to set process priority: {0} (will not prevent BIF generation!)", e.Message); + } lock (_runningProcessesLock) { diff --git a/Nick.Plugin.Jellyscrub/Drawing/VideoProcessor.cs b/Nick.Plugin.Jellyscrub/Drawing/VideoProcessor.cs index b6dc9d0..3ab6ef7 100644 --- a/Nick.Plugin.Jellyscrub/Drawing/VideoProcessor.cs +++ b/Nick.Plugin.Jellyscrub/Drawing/VideoProcessor.cs @@ -231,6 +231,11 @@ await _oldEncoder.ExtractVideoImagesOnInterval(inputPath, mediaSource.Container, { Directory.CreateDirectory(Directory.GetParent(path).FullName); File.Copy(bifTempPath, path, true); + + // Create .ignore file so trickplay folder is not picked up as a season when TV folder structure is improper. + var ignorePath = Path.Combine(Directory.GetParent(path).FullName, ".ignore"); + if (!File.Exists(ignorePath)) File.Create(ignorePath); + _logger.LogInformation("Finished creation of trickplay file {0}", path); } finally diff --git a/Nick.Plugin.Jellyscrub/Nick.Plugin.Jellyscrub.csproj b/Nick.Plugin.Jellyscrub/Nick.Plugin.Jellyscrub.csproj index 6d7004b..f6e4e0f 100644 --- a/Nick.Plugin.Jellyscrub/Nick.Plugin.Jellyscrub.csproj +++ b/Nick.Plugin.Jellyscrub/Nick.Plugin.Jellyscrub.csproj @@ -4,13 +4,13 @@ net6.0 enable enable - 1.0.0.6 - 1.0.0.6 + 1.0.0.7 + 1.0.0.7 - - + +