mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-06 18:26:33 +00:00
add transcode temp path migration
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Common.Implementations.Configuration;
|
||||
using MediaBrowser.Controller;
|
||||
@@ -75,6 +76,13 @@ namespace MediaBrowser.Server.Implementations.Configuration
|
||||
base.OnConfigurationUpdated();
|
||||
}
|
||||
|
||||
public override void AddParts(IEnumerable<IConfigurationFactory> factories)
|
||||
{
|
||||
base.AddParts(factories);
|
||||
|
||||
UpdateTranscodingTempPath();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the items by name path.
|
||||
/// </summary>
|
||||
@@ -95,6 +103,28 @@ namespace MediaBrowser.Server.Implementations.Configuration
|
||||
Configuration.MetadataPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the transcoding temporary path.
|
||||
/// </summary>
|
||||
private void UpdateTranscodingTempPath()
|
||||
{
|
||||
var encodingConfig = this.GetConfiguration<EncodingOptions>("encoding");
|
||||
|
||||
((ServerApplicationPaths)ApplicationPaths).TranscodingTempPath = string.IsNullOrEmpty(encodingConfig.TranscodingTempPath) ?
|
||||
null :
|
||||
encodingConfig.TranscodingTempPath;
|
||||
}
|
||||
|
||||
protected override void OnNamedConfigurationUpdated(string key, object configuration)
|
||||
{
|
||||
base.OnNamedConfigurationUpdated(key, configuration);
|
||||
|
||||
if (string.Equals(key, "encoding", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
UpdateTranscodingTempPath();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces the configuration.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user