diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2023-02-20 11:49:40 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2023-02-20 11:54:39 +0100 |
| commit | f0251f86cb7d88495de0000d0ebca01fd9b8bbbe (patch) | |
| tree | 11feeddce7da6b65197b6e23f6b29e77fc885766 | |
| parent | 5cdb0c7932303d2d9a59d7d21860172fd97fe031 (diff) | |
Move MigrateRatingLevels migration to preStartup
| -rw-r--r-- | Jellyfin.Server/Migrations/MigrationRunner.cs | 6 | ||||
| -rw-r--r-- | Jellyfin.Server/Migrations/PreStartupRoutines/MigrateRatingLevels.cs (renamed from Jellyfin.Server/Migrations/Routines/MigrateRatingLevels.cs) | 13 |
2 files changed, 10 insertions, 9 deletions
diff --git a/Jellyfin.Server/Migrations/MigrationRunner.cs b/Jellyfin.Server/Migrations/MigrationRunner.cs index 2b15a6a1b..d4bf81f10 100644 --- a/Jellyfin.Server/Migrations/MigrationRunner.cs +++ b/Jellyfin.Server/Migrations/MigrationRunner.cs @@ -22,7 +22,8 @@ namespace Jellyfin.Server.Migrations private static readonly Type[] _preStartupMigrationTypes = { typeof(PreStartupRoutines.CreateNetworkConfiguration), - typeof(PreStartupRoutines.MigrateMusicBrainzTimeout) + typeof(PreStartupRoutines.MigrateMusicBrainzTimeout), + typeof(PreStartupRoutines.MigrateRatingLevels) }; /// <summary> @@ -39,8 +40,7 @@ namespace Jellyfin.Server.Migrations typeof(Routines.ReaddDefaultPluginRepository), typeof(Routines.MigrateDisplayPreferencesDb), typeof(Routines.RemoveDownloadImagesInAdvance), - typeof(Routines.MigrateAuthenticationDb), - typeof(Routines.MigrateRatingLevels) + typeof(Routines.MigrateAuthenticationDb) }; /// <summary> diff --git a/Jellyfin.Server/Migrations/Routines/MigrateRatingLevels.cs b/Jellyfin.Server/Migrations/PreStartupRoutines/MigrateRatingLevels.cs index f30eb8421..465bbd7fe 100644 --- a/Jellyfin.Server/Migrations/Routines/MigrateRatingLevels.cs +++ b/Jellyfin.Server/Migrations/PreStartupRoutines/MigrateRatingLevels.cs @@ -2,11 +2,12 @@ using System; using System.Globalization; using System.IO; +using Emby.Server.Implementations; using MediaBrowser.Controller; using Microsoft.Extensions.Logging; using SQLitePCL.pretty; -namespace Jellyfin.Server.Migrations.Routines +namespace Jellyfin.Server.Migrations.PreStartupRoutines { /// <summary> /// Migrate rating levels to new rating level system. @@ -15,12 +16,12 @@ namespace Jellyfin.Server.Migrations.Routines { private const string DbFilename = "library.db"; private readonly ILogger<MigrateRatingLevels> _logger; - private readonly IServerApplicationPaths _paths; + private readonly IServerApplicationPaths _applicationPaths; - public MigrateRatingLevels(ILogger<MigrateRatingLevels> logger, IServerApplicationPaths paths) + public MigrateRatingLevels(ServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory) { - _logger = logger; - _paths = paths; + _applicationPaths = applicationPaths; + _logger = loggerFactory.CreateLogger<MigrateRatingLevels>(); } /// <inheritdoc/> @@ -35,7 +36,7 @@ namespace Jellyfin.Server.Migrations.Routines /// <inheritdoc/> public void Perform() { - var dataPath = _paths.DataPath; + var dataPath = _applicationPaths.DataPath; var dbPath = Path.Combine(dataPath, DbFilename); using (var connection = SQLite3.Open( dbPath, |
