diff options
| author | Vasily <just.one.man@yandex.ru> | 2020-03-05 20:40:17 +0300 |
|---|---|---|
| committer | Vasily <just.one.man@yandex.ru> | 2020-03-05 20:40:17 +0300 |
| commit | 55b429e5e816bea33afbd810d5f1e4f560ef0069 (patch) | |
| tree | b6e37c7e2ce7453bf4d248b107336ee9544ca271 /Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs | |
| parent | ccafebca68fc09040572d0a21420ea9e5d6c1088 (diff) | |
Moved migration routines to their own directory
Diffstat (limited to 'Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs')
| -rw-r--r-- | Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs | 32 |
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..eff6469e2 --- /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> + /// Updater that takes care of bringing configuration up to 10.5.0 standards. + /// </summary> + internal class DisableTranscodingThrottling : IUpdater + { + /// <inheritdoc/> + public string Name => "DisableTranscodingThrottling"; + + /// <inheritdoc/> + public void Perform(CoreAppHost host, ILogger logger) + { + // Set EnableThrottling to false as it wasn't used before, and in 10.5.0 it 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); + } + } + } +} |
