The Free Software Media System - Server Backend & API
update migration process
Luke Pulverenti47005468752c
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.csindex a11eb3aaa7..e69ff367a4 100644--- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs@@ -350,16 +350,11 @@ namespace MediaBrowser.Server.Implementations.HttpServerif (!string.IsNullOrWhiteSpace(GlobalResponse)){- if (string.Equals(GetExtension(urlString), "html", StringComparison.OrdinalIgnoreCase))- {- httpRes.Write(GlobalResponse);- httpRes.ContentType = "text/plain";- }- else- {- httpRes.StatusCode = 503;- }+ httpRes.StatusCode = 503;+ httpRes.ContentType = "text/html";+ httpRes.Write(GlobalResponse);+ httpRes.Close();return Task.FromResult(true);}diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.csindex 9d63435685..a858729512 100644--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs@@ -80,7 +80,7 @@ namespace MediaBrowser.Server.Implementations.Persistenceprivate IDbCommand _updateInheritedRatingCommand;- private const int LatestSchemaVersion = 45;+ private const int LatestSchemaVersion = 48;/// <summary>/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.csindex 3cd92bcde8..65517c09c2 100644--- a/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs+++ b/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs@@ -18,15 +18,21 @@ namespace MediaBrowser.Server.Startup.Common.Migrationspublic void Run(){- if (_config.Configuration.MigrationVersion < CleanDatabaseScheduledTask.MigrationVersion &&- _config.Configuration.IsStartupWizardCompleted)+ if (_config.Configuration.MigrationVersion < CleanDatabaseScheduledTask.MigrationVersion){+ if (!_config.Configuration.IsStartupWizardCompleted)+ {+ _config.Configuration.MigrationVersion = CleanDatabaseScheduledTask.MigrationVersion;+ _config.SaveConfiguration();+ return;+ }+_taskManager.SuspendTriggers = true;CleanDatabaseScheduledTask.EnableUnavailableMessage = true;Task.Run(async () =>{- await Task.Delay(100).ConfigureAwait(false);+ await Task.Delay(1000).ConfigureAwait(false);_taskManager.Execute<CleanDatabaseScheduledTask>();});