aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-03-07 21:14:14 -0500
committerGitHub <noreply@github.com>2020-03-07 21:14:14 -0500
commit3d563ca3a3c8398617ef014f53ba9d0937a55d94 (patch)
treed4d1ad6eb94a450ff6f2e299d97b6720086583f7 /Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
parentadc3ab19913e697ae0bd1fbf1cf8cda12041b71b (diff)
parent1295f6c79bdf76274501838c9e42094e4b1dd3c0 (diff)
Merge pull request #2523 from JustAMan/logging-migration
Improve migrations so they are more maintainable
Diffstat (limited to 'Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs')
-rw-r--r--Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs32
1 files changed, 32 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..936c3640e
--- /dev/null
+++ b/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
@@ -0,0 +1,32 @@
+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 : IUpdater
+ {
+ /// <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);
+ }
+ }
+ }
+}