mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 21:08:27 +01:00
Add GPL modules
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Common.Configuration
|
||||
{
|
||||
public class ConfigurationUpdateEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the key.
|
||||
/// </summary>
|
||||
/// <value>The key.</value>
|
||||
public string Key { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the new configuration.
|
||||
/// </summary>
|
||||
/// <value>The new configuration.</value>
|
||||
public object NewConfiguration { get; set; }
|
||||
}
|
||||
}
|
||||
84
MediaBrowser.Common/Configuration/IApplicationPaths.cs
Normal file
84
MediaBrowser.Common/Configuration/IApplicationPaths.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
|
||||
namespace MediaBrowser.Common.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IApplicationPaths
|
||||
/// </summary>
|
||||
public interface IApplicationPaths
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the path to the program data folder
|
||||
/// </summary>
|
||||
/// <value>The program data path.</value>
|
||||
string ProgramDataPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the program system folder
|
||||
/// </summary>
|
||||
/// <value>The program data path.</value>
|
||||
string ProgramSystemPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the folder path to the data directory
|
||||
/// </summary>
|
||||
/// <value>The data directory.</value>
|
||||
string DataPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image cache path.
|
||||
/// </summary>
|
||||
/// <value>The image cache path.</value>
|
||||
string ImageCachePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the plugin directory
|
||||
/// </summary>
|
||||
/// <value>The plugins path.</value>
|
||||
string PluginsPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the plugin configurations directory
|
||||
/// </summary>
|
||||
/// <value>The plugin configurations path.</value>
|
||||
string PluginConfigurationsPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to where temporary update files will be stored
|
||||
/// </summary>
|
||||
/// <value>The plugin configurations path.</value>
|
||||
string TempUpdatePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the log directory
|
||||
/// </summary>
|
||||
/// <value>The log directory path.</value>
|
||||
string LogDirectoryPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the application configuration root directory
|
||||
/// </summary>
|
||||
/// <value>The configuration directory path.</value>
|
||||
string ConfigurationDirectoryPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the system configuration file
|
||||
/// </summary>
|
||||
/// <value>The system configuration file path.</value>
|
||||
string SystemConfigurationFilePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the folder path to the cache directory
|
||||
/// </summary>
|
||||
/// <value>The cache directory.</value>
|
||||
string CachePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the folder path to the temp directory within the cache folder
|
||||
/// </summary>
|
||||
/// <value>The temp directory.</value>
|
||||
string TempDirectory { get; }
|
||||
|
||||
string VirtualDataPath { get; }
|
||||
}
|
||||
|
||||
}
|
||||
22
MediaBrowser.Common/Configuration/IConfigurationFactory.cs
Normal file
22
MediaBrowser.Common/Configuration/IConfigurationFactory.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Common.Configuration
|
||||
{
|
||||
public interface IConfigurationFactory
|
||||
{
|
||||
IEnumerable<ConfigurationStore> GetConfigurations();
|
||||
}
|
||||
|
||||
public class ConfigurationStore
|
||||
{
|
||||
public string Key { get; set; }
|
||||
|
||||
public Type ConfigurationType { get; set; }
|
||||
}
|
||||
|
||||
public interface IValidatingConfiguration
|
||||
{
|
||||
void Validate(object oldConfig, object newConfig);
|
||||
}
|
||||
}
|
||||
82
MediaBrowser.Common/Configuration/IConfigurationManager.cs
Normal file
82
MediaBrowser.Common/Configuration/IConfigurationManager.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Common.Configuration
|
||||
{
|
||||
public interface IConfigurationManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Occurs when [configuration updating].
|
||||
/// </summary>
|
||||
event EventHandler<ConfigurationUpdateEventArgs> NamedConfigurationUpdating;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [configuration updated].
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> ConfigurationUpdated;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [named configuration updated].
|
||||
/// </summary>
|
||||
event EventHandler<ConfigurationUpdateEventArgs> NamedConfigurationUpdated;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the application paths.
|
||||
/// </summary>
|
||||
/// <value>The application paths.</value>
|
||||
IApplicationPaths CommonApplicationPaths { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the configuration.
|
||||
/// </summary>
|
||||
/// <value>The configuration.</value>
|
||||
BaseApplicationConfiguration CommonConfiguration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Saves the configuration.
|
||||
/// </summary>
|
||||
void SaveConfiguration();
|
||||
|
||||
/// <summary>
|
||||
/// Replaces the configuration.
|
||||
/// </summary>
|
||||
/// <param name="newConfiguration">The new configuration.</param>
|
||||
void ReplaceConfiguration(BaseApplicationConfiguration newConfiguration);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the configuration.
|
||||
/// </summary>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
object GetConfiguration(string key);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the configuration.
|
||||
/// </summary>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <returns>Type.</returns>
|
||||
Type GetConfigurationType(string key);
|
||||
|
||||
/// <summary>
|
||||
/// Saves the configuration.
|
||||
/// </summary>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <param name="configuration">The configuration.</param>
|
||||
void SaveConfiguration(string key, object configuration);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the parts.
|
||||
/// </summary>
|
||||
/// <param name="factories">The factories.</param>
|
||||
void AddParts(IEnumerable<IConfigurationFactory> factories);
|
||||
}
|
||||
|
||||
public static class ConfigurationManagerExtensions
|
||||
{
|
||||
public static T GetConfiguration<T>(this IConfigurationManager manager, string key)
|
||||
{
|
||||
return (T)manager.GetConfiguration(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user