parent
66e11879ef
commit
ecaa7f8014
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using MediaBrowser.Common.Configuration;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Serilog;
|
||||||
|
using ILogger = Microsoft.Extensions.Logging.ILogger;
|
||||||
|
|
||||||
|
namespace Jellyfin.Server.Migrations
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Updater that takes care of bringing configuration up to 10.5.0 standards.
|
||||||
|
/// </summary>
|
||||||
|
internal class DisableZealousLogging : IUpdater
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public string Name => "DisableZealousLogging";
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
// This tones down logging from some components
|
||||||
|
public void Perform(CoreAppHost host, ILogger logger)
|
||||||
|
{
|
||||||
|
string configPath = Path.Combine(host.ServerConfigurationManager.ApplicationPaths.ConfigurationDirectoryPath, Program.LoggingConfigFile);
|
||||||
|
// TODO: fix up the config
|
||||||
|
throw new NotImplementedException("don't know how to fix logging yet");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
namespace Jellyfin.Server.Migrations
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Configuration part that holds all migrations that were applied.
|
||||||
|
/// </summary>
|
||||||
|
public class MigrationOptions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="MigrationOptions"/> class.
|
||||||
|
/// </summary>
|
||||||
|
public MigrationOptions()
|
||||||
|
{
|
||||||
|
Applied = System.Array.Empty<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma warning disable CA1819 // Properties should not return arrays
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets he list of applied migration routine names.
|
||||||
|
/// </summary>
|
||||||
|
public string[] Applied { get; set; }
|
||||||
|
#pragma warning restore CA1819 // Properties should not return arrays
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using MediaBrowser.Common.Configuration;
|
||||||
|
|
||||||
|
namespace Jellyfin.Server.Migrations
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A factory that teachs Jellyfin how to find a peristent file which lists all applied migrations.
|
||||||
|
/// </summary>
|
||||||
|
public class MigrationsFactory : IConfigurationFactory
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public IEnumerable<ConfigurationStore> GetConfigurations()
|
||||||
|
{
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
new MigrationsListStore()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
using MediaBrowser.Common.Configuration;
|
||||||
|
|
||||||
|
namespace Jellyfin.Server.Migrations
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A configuration that lists all the migration routines that were applied.
|
||||||
|
/// </summary>
|
||||||
|
public class MigrationsListStore : ConfigurationStore
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="MigrationsListStore"/> class.
|
||||||
|
/// </summary>
|
||||||
|
public MigrationsListStore()
|
||||||
|
{
|
||||||
|
ConfigurationType = typeof(MigrationOptions);
|
||||||
|
Key = "migrations";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue