You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
5 years ago
|
using System;
|
||
5 years ago
|
using System.IO;
|
||
5 years ago
|
using MediaBrowser.Common.Configuration;
|
||
|
using MediaBrowser.Model.Configuration;
|
||
5 years ago
|
using Microsoft.Extensions.Configuration;
|
||
5 years ago
|
using Microsoft.Extensions.Logging;
|
||
|
|
||
5 years ago
|
namespace Jellyfin.Server.Migrations.Routines
|
||
5 years ago
|
{
|
||
|
/// <summary>
|
||
|
/// Updater that takes care of bringing configuration up to 10.5.0 standards.
|
||
|
/// </summary>
|
||
5 years ago
|
internal class DisableTranscodingThrottling : IUpdater
|
||
5 years ago
|
{
|
||
|
/// <inheritdoc/>
|
||
5 years ago
|
public string Name => "DisableTranscodingThrottling";
|
||
5 years ago
|
|
||
|
/// <inheritdoc/>
|
||
5 years ago
|
public void Perform(CoreAppHost host, ILogger logger)
|
||
5 years ago
|
{
|
||
|
// 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);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|