mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-23 10:34:43 +01:00
add transcode temp path migration
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user