mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
Slight re-work of ApplicationPaths so that we can have inherited versions for the UI and Server
This commit is contained in:
parent
a508a997d9
commit
59a3dcc8c1
@@ -18,14 +18,17 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// <summary>
|
||||
/// Represents a shared base kernel for both the UI and server apps
|
||||
/// </summary>
|
||||
public abstract class BaseKernel<TConfigurationType> : IDisposable
|
||||
public abstract class BaseKernel<TConfigurationType, TApplicationPathsType> : IDisposable
|
||||
where TConfigurationType : BaseApplicationConfiguration, new()
|
||||
where TApplicationPathsType : BaseApplicationPaths, new()
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the current configuration
|
||||
/// </summary>
|
||||
public TConfigurationType Configuration { get; private set; }
|
||||
|
||||
public TApplicationPathsType ApplicationPaths { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of currently loaded plugins
|
||||
/// </summary>
|
||||
@@ -45,7 +48,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
|
||||
public BaseKernel()
|
||||
{
|
||||
|
||||
ApplicationPaths = new TApplicationPathsType();
|
||||
}
|
||||
|
||||
public virtual void Init(IProgress<TaskProgress> progress)
|
||||
@@ -149,13 +152,13 @@ namespace MediaBrowser.Common.Kernel
|
||||
//Configuration information for anything other than server-specific configuration will have to come via the API... -ebr
|
||||
|
||||
// Deserialize config
|
||||
if (!File.Exists(ApplicationPaths.ConfigurationPath))
|
||||
if (!File.Exists(ApplicationPaths.SystemConfigurationFilePath))
|
||||
{
|
||||
Configuration = new TConfigurationType();
|
||||
}
|
||||
else
|
||||
{
|
||||
Configuration = JsonSerializer.DeserializeFromFile<TConfigurationType>(ApplicationPaths.ConfigurationPath);
|
||||
Configuration = XmlSerializer.DeserializeFromFile<TConfigurationType>(ApplicationPaths.SystemConfigurationFilePath);
|
||||
}
|
||||
|
||||
Logger.LoggerInstance.LogSeverity = Configuration.LogSeverity;
|
||||
|
||||
Reference in New Issue
Block a user