mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-19 16:46:36 +00:00
Changes as requested
This commit is contained in:
@@ -25,8 +25,6 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// </summary>
|
||||
private readonly object _configurationSaveLock = new object();
|
||||
|
||||
private Action<string> _directoryCreateFn;
|
||||
|
||||
/// <summary>
|
||||
/// The configuration.
|
||||
/// </summary>
|
||||
@@ -65,11 +63,6 @@ namespace MediaBrowser.Common.Plugins
|
||||
assemblyPlugin.SetId(assemblyId);
|
||||
}
|
||||
}
|
||||
|
||||
if (this is IHasPluginConfiguration hasPluginConfiguration)
|
||||
{
|
||||
hasPluginConfiguration.SetStartupInfo(s => Directory.CreateDirectory(s));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -145,13 +138,6 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// <value>The configuration.</value>
|
||||
BasePluginConfiguration IHasPluginConfiguration.Configuration => Configuration;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SetStartupInfo(Action<string> directoryCreateFn)
|
||||
{
|
||||
// hack alert, until the .net core transition is complete
|
||||
_directoryCreateFn = directoryCreateFn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves the current configuration to the file system.
|
||||
/// </summary>
|
||||
@@ -160,7 +146,11 @@ namespace MediaBrowser.Common.Plugins
|
||||
{
|
||||
lock (_configurationSaveLock)
|
||||
{
|
||||
_directoryCreateFn(Path.GetDirectoryName(ConfigurationFilePath));
|
||||
var folder = Path.GetDirectoryName(ConfigurationFilePath);
|
||||
if (!Directory.Exists(folder))
|
||||
{
|
||||
Directory.CreateDirectory(folder);
|
||||
}
|
||||
|
||||
XmlSerializer.SerializeToFile(config, ConfigurationFilePath);
|
||||
}
|
||||
|
||||
@@ -23,11 +23,5 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// </summary>
|
||||
/// <param name="configuration">The configuration.</param>
|
||||
void UpdateConfiguration(BasePluginConfiguration configuration);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the startup directory creation function.
|
||||
/// </summary>
|
||||
/// <param name="directoryCreateFn">The directory function used to create the configuration folder.</param>
|
||||
void SetStartupInfo(Action<string> directoryCreateFn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MediaBrowser.Common.Plugins
|
||||
|
||||
@@ -19,14 +19,12 @@ namespace MediaBrowser.Common.Plugins
|
||||
Category = string.Empty;
|
||||
Changelog = string.Empty;
|
||||
Description = string.Empty;
|
||||
Status = PluginStatus.Active;
|
||||
Id = Guid.Empty;
|
||||
Name = string.Empty;
|
||||
Owner = string.Empty;
|
||||
Overview = string.Empty;
|
||||
TargetAbi = string.Empty;
|
||||
Version = string.Empty;
|
||||
AutoUpdate = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -99,7 +97,7 @@ namespace MediaBrowser.Common.Plugins
|
||||
/// Gets or sets a value indicating whether this plugin should automatically update.
|
||||
/// </summary>
|
||||
[JsonPropertyName("autoUpdate")]
|
||||
public bool AutoUpdate { get; set; }
|
||||
public bool AutoUpdate { get; set; } = true; // DO NOT MOVE THIS INTO THE CONSTRUCTOR.
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ImagePath
|
||||
|
||||
Reference in New Issue
Block a user