diff options
| author | Pika <15848969+ThatNerdyPikachu@users.noreply.github.com> | 2020-07-23 18:59:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-23 18:59:25 -0400 |
| commit | 3b21abd879c278bdc7d2f02a62eba3a57cb55987 (patch) | |
| tree | f045e94b60f1f8d6eb63bfda957209e110b1d82c /Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs | |
| parent | 7aba10eff67151a9f6593e9d3d702f17029b994f (diff) | |
| parent | 845ee21ddce8ed91d8c3c1463d0d7a06bb769635 (diff) | |
Merge branch 'master' into more-track-titles
Diffstat (limited to 'Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs')
| -rw-r--r-- | Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs b/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs index 6f8e4a8ff..0925a87b5 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<DisableTranscodingThrottling> _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,19 @@ namespace Jellyfin.Server.Migrations.Routines public string Name => "DisableTranscodingThrottling"; /// <inheritdoc/> - public void Perform(CoreAppHost host, ILogger logger) + public bool PerformOnNewInstall => false; + + /// <inheritdoc/> + 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); } } } |
