Skip to content

Commit

Permalink
Merge pull request #52 from nicknsy/beta-1.0.0.7
Browse files Browse the repository at this point in the history
Beta 1.0.0.7
  • Loading branch information
nicknsy authored Nov 27, 2022
2 parents 4ce806f + 97d4077 commit 929854d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Jellyscrub.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Nick.Plugin.Jellyscrub/Api/trickplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 6 additions & 0 deletions Nick.Plugin.Jellyscrub/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public PluginConfiguration() {}
/// </summary>
public MetadataScanBehavior ScanBehavior { get; set; } = MetadataScanBehavior.NonBlocking;

/// <summary>
/// The process priority of the ffmpeg .bif generation process.
/// default = BelowNormal
/// </summary>
public ProcessPriorityClass ProcessPriority { get; set; } = ProcessPriorityClass.BelowNormal;

/// <summary>
/// Whether to save BIFs in the same media folder as their corresponding video.
/// default = false
Expand Down
16 changes: 16 additions & 0 deletions Nick.Plugin.Jellyscrub/Configuration/configPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@
<div class="fieldDescription"><strong>Note:</strong> Do not include spaces after commas.</div>
</div>

<div class="inputContainer">
<select is="emby-select" id="processPriority" name="Process Priority" label="Process Priority">
<!--<option id="optPriorityRealtime" value="Realtime">Realtime</option>-->
<option id="optPriorityHigh" value="High">High</option>
<option id="optPriorityAboveNormal" value="AboveNormal">Above Normal</option>
<option id="optPriorityNormal" value="Normal">Normal</option>
<option id="optPriorityBelowNormal" value="BelowNormal">Below Normal</option>
<option id="optPriorityIdle" value="Idle">Idle</option>
</select>
<div class="fieldDescription">Setting this lower or higher will determine how the CPU prioritizes the ffmpeg .bif generation process in relation to other processes.</div>
<div class="fieldDescription">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.</div>
<!--<div class="fieldDescription"><strong>Note:</strong> Setting this to Realtime might freeze the PC during bif generation!</div>-->
</div>

<div class="inputContainer">
<input is="emby-input" type="number" id="processThreads" pattern="[0-9]*" required="" label="FFmpeg Threads">
<div class="fieldDescription">The number of threads to pass to the "-threads" argument of ffmpeg.</div>
Expand Down Expand Up @@ -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();
Expand All @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions Nick.Plugin.Jellyscrub/Drawing/OldMediaEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 5 additions & 0 deletions Nick.Plugin.Jellyscrub/Drawing/VideoProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Nick.Plugin.Jellyscrub/Nick.Plugin.Jellyscrub.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyVersion>1.0.0.6</AssemblyVersion>
<FileVersion>1.0.0.6</FileVersion>
<AssemblyVersion>1.0.0.7</AssemblyVersion>
<FileVersion>1.0.0.7</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.8.1" />
<PackageReference Include="Jellyfin.Model" Version="10.8.1" />
<PackageReference Include="Jellyfin.Controller" Version="10.8.4" />
<PackageReference Include="Jellyfin.Model" Version="10.8.4" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 929854d

Please sign in to comment.