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.
jellyfin/MediaBrowser.Server.Startup.../Migrations/MigrateTranscodingPath.cs

31 lines
968 B

using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Server.Startup.Common.Migrations
{
public class MigrateTranscodingPath : IVersionMigration
{
private readonly IServerConfigurationManager _config;
public MigrateTranscodingPath(IServerConfigurationManager config)
{
_config = config;
}
public void Run()
{
if (!string.IsNullOrWhiteSpace(_config.Configuration.TranscodingTempPath))
{
var newConfig = _config.GetConfiguration<EncodingOptions>("encoding");
newConfig.TranscodingTempPath = _config.Configuration.TranscodingTempPath;
_config.SaveConfiguration("encoding", newConfig);
_config.Configuration.TranscodingTempPath = null;
_config.SaveConfiguration();
}
}
}
}