Update Jellyfin.Server/Migrations/MigrationRunner.cs

Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
Stoica Tedy 2021-12-14 09:57:20 +02:00
parent 250332104b
commit 4e03801931
No known key found for this signature in database
GPG Key ID: C29A238B2A1A7945

View File

@ -75,11 +75,9 @@ namespace Jellyfin.Server.Migrations
var xmlSerializer = new MyXmlSerializer();
var migrationConfigPath = Path.Join(appPaths.ConfigurationDirectoryPath, MigrationsListStore.StoreKey.ToLowerInvariant() + ".xml");
if (!File.Exists(migrationConfigPath))
{
return;
}
var migrationOptions = (MigrationOptions)xmlSerializer.DeserializeFromFile(typeof(MigrationOptions), migrationConfigPath)!;
var migrationOptions = File.Exists(migrationConfigPath)
? (MigrationOptions)xmlSerializer.DeserializeFromFile(typeof(MigrationOptions), migrationConfigPath)!
: new MigrationOptions();
// We have to deserialize it manually since the configuration manager may overwrite it
var serverConfig = (ServerConfiguration)xmlSerializer.DeserializeFromFile(typeof(ServerConfiguration), appPaths.SystemConfigurationFilePath)!;