diff options
| author | Patrick Barron <18354464+barronpm@users.noreply.github.com> | 2020-05-12 16:08:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-12 16:08:28 +0000 |
| commit | 6379391f871424177c6048a54ccd061d6e44bc4a (patch) | |
| tree | cf268efbe2d8aaeee964ef8e893ae382abf88ad4 /Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs | |
| parent | 37dcbfbc3980ed962c28fe7f1ee9d8a78f65ec19 (diff) | |
| parent | 32c118222647f121c0b17055c0ef158763c0b5d2 (diff) | |
Merge branch 'master' into activitydb-efcore
Diffstat (limited to 'Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs')
| -rw-r--r-- | Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs b/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs index 6f8e4a8ff..b2e957d5b 100644 --- a/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs +++ b/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs @@ -10,6 +10,15 @@ namespace Jellyfin.Server.Migrations.Routines /// </summary> internal class DisableTranscodingThrottling : IMigrationRoutine { + private readonly ILogger _logger; + private readonly IConfigurationManager _configManager; + + public DisableTranscodingThrottling(ILogger<DisableTranscodingThrottling> logger, IConfigurationManager configManager) + { + _logger = logger; + _configManager = configManager; + } + /// <inheritdoc/> public Guid Id => Guid.Parse("{4124C2CD-E939-4FFB-9BE9-9B311C413638}"); @@ -17,16 +26,16 @@ namespace Jellyfin.Server.Migrations.Routines public string Name => "DisableTranscodingThrottling"; /// <inheritdoc/> - public void Perform(CoreAppHost host, ILogger logger) + public void Perform() { // Set EnableThrottling to false since it wasn't used before and may introduce issues - var encoding = ((IConfigurationManager)host.ServerConfigurationManager).GetConfiguration<EncodingOptions>("encoding"); + var encoding = _configManager.GetConfiguration<EncodingOptions>("encoding"); if (encoding.EnableThrottling) { - logger.LogInformation("Disabling transcoding throttling during migration"); + _logger.LogInformation("Disabling transcoding throttling during migration"); encoding.EnableThrottling = false; - host.ServerConfigurationManager.SaveConfiguration("encoding", encoding); + _configManager.SaveConfiguration("encoding", encoding); } } } |
