aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-03-11 23:04:47 +0100
committerMark Monteiro <marknr.monteiro@protonmail.com>2020-03-11 23:04:47 +0100
commit99bf6edba27c48db6094d1364a7175a0af9158b5 (patch)
tree87ea497716c6e92ae9b7e3cfc540256350b05430 /Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
parentd437950ac30ee294ab275362abe711ae3c14ac32 (diff)
parent008a76cf4d7f04eee2f0e1b8d135ea835d7ec7e2 (diff)
Merge remote-tracking branch 'upstream/master' into support-running-without-web-content
Diffstat (limited to 'Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs')
-rw-r--r--Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs b/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
new file mode 100644
index 000000000..673f0e415
--- /dev/null
+++ b/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
@@ -0,0 +1,35 @@
+using System;
+using System.IO;
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Model.Configuration;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+
+namespace Jellyfin.Server.Migrations.Routines
+{
+ /// <summary>
+ /// Disable transcode throttling for all installations since it is currently broken for certain video formats.
+ /// </summary>
+ internal class DisableTranscodingThrottling : IMigrationRoutine
+ {
+ /// <inheritdoc/>
+ public Guid Id => Guid.Parse("{4124C2CD-E939-4FFB-9BE9-9B311C413638}");
+
+ /// <inheritdoc/>
+ public string Name => "DisableTranscodingThrottling";
+
+ /// <inheritdoc/>
+ public void Perform(CoreAppHost host, ILogger logger)
+ {
+ // Set EnableThrottling to false since it wasn't used before and may introduce issues
+ var encoding = ((IConfigurationManager)host.ServerConfigurationManager).GetConfiguration<EncodingOptions>("encoding");
+ if (encoding.EnableThrottling)
+ {
+ logger.LogInformation("Disabling transcoding throttling during migration");
+ encoding.EnableThrottling = false;
+
+ host.ServerConfigurationManager.SaveConfiguration("encoding", encoding);
+ }
+ }
+ }
+}