mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Prepared Seperation of Database components for future multi provider support
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.DatabaseConfiguration;
|
||||
|
||||
/// <summary>
|
||||
/// Factory for constructing a database configuration.
|
||||
/// </summary>
|
||||
public class DatabaseConfigurationFactory : IConfigurationFactory
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<ConfigurationStore> GetConfigurations()
|
||||
{
|
||||
yield return new DatabaseConfigurationStore();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.DatabaseConfiguration;
|
||||
|
||||
/// <summary>
|
||||
/// Options to configure jellyfins managed database.
|
||||
/// </summary>
|
||||
public class DatabaseConfigurationOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets the type of database jellyfin should use.
|
||||
/// </summary>
|
||||
public required string DatabaseType { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.DatabaseConfiguration;
|
||||
|
||||
/// <summary>
|
||||
/// A configuration that stores database related settings.
|
||||
/// </summary>
|
||||
public class DatabaseConfigurationStore : ConfigurationStore
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the configuration in the storage.
|
||||
/// </summary>
|
||||
public const string StoreKey = "database";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DatabaseConfigurationStore"/> class.
|
||||
/// </summary>
|
||||
public DatabaseConfigurationStore()
|
||||
{
|
||||
ConfigurationType = typeof(DatabaseConfigurationOptions);
|
||||
Key = StoreKey;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user