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) }; /// @@ -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) }; /// diff --git a/Jellyfin.Server/Migrations/Routines/MigrateRatingLevels.cs b/Jellyfin.Server/Migrations/PreStartupRoutines/MigrateRatingLevels.cs similarity index 90% rename from Jellyfin.Server/Migrations/Routines/MigrateRatingLevels.cs rename to 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 { /// /// 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 _logger; - private readonly IServerApplicationPaths _paths; + private readonly IServerApplicationPaths _applicationPaths; - public MigrateRatingLevels(ILogger logger, IServerApplicationPaths paths) + public MigrateRatingLevels(ServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory) { - _logger = logger; - _paths = paths; + _applicationPaths = applicationPaths; + _logger = loggerFactory.CreateLogger(); } /// @@ -35,7 +36,7 @@ namespace Jellyfin.Server.Migrations.Routines /// public void Perform() { - var dataPath = _paths.DataPath; + var dataPath = _applicationPaths.DataPath; var dbPath = Path.Combine(dataPath, DbFilename); using (var connection = SQLite3.Open( dbPath,