Extract "migrations" config name to a proper constant

pull/2523/head
Vasily 4 years ago
parent ecaa7f8014
commit ccafebca68

@ -27,7 +27,7 @@ namespace Jellyfin.Server.Migrations
public static void Run(CoreAppHost host, ILoggerFactory loggerFactory)
{
var logger = loggerFactory.CreateLogger<MigrationRunner>();
var migrationOptions = ((IConfigurationManager)host.ServerConfigurationManager).GetConfiguration<MigrationOptions>("migrations");
var migrationOptions = ((IConfigurationManager)host.ServerConfigurationManager).GetConfiguration<MigrationOptions>(MigrationsListStore.StoreKey);
var applied = migrationOptions.Applied.ToList();
for (var i = 0; i < Migrations.Length; i++)
@ -56,7 +56,7 @@ namespace Jellyfin.Server.Migrations
{
logger.LogInformation("Some migrations were run, saving the state");
migrationOptions.Applied = applied.ToArray();
host.ServerConfigurationManager.SaveConfiguration("migrations", migrationOptions);
host.ServerConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);
}
}
}

@ -7,13 +7,18 @@ namespace Jellyfin.Server.Migrations
/// </summary>
public class MigrationsListStore : ConfigurationStore
{
/// <summary>
/// The name of the configuration in the storage.
/// </summary>
public static readonly string StoreKey = "migrations";
/// <summary>
/// Initializes a new instance of the <see cref="MigrationsListStore"/> class.
/// </summary>
public MigrationsListStore()
{
ConfigurationType = typeof(MigrationOptions);
Key = "migrations";
Key = StoreKey;
}
}
}

Loading…
Cancel
Save