This commit is contained in:
tidusjar 2016-05-27 13:50:27 +01:00
commit 34e74c74c1
6 changed files with 169 additions and 56 deletions

View file

@ -53,7 +53,7 @@ namespace PlexRequests.Core
{
CreateDefaultSettingsPage(urlBase);
}
var version = CheckSchema();
if (version > 0)
{
@ -77,7 +77,7 @@ namespace PlexRequests.Core
{
var productVersion = AssemblyHelper.GetProductVersion();
var trimStatus = new Regex("[^0-9]", RegexOptions.Compiled).Replace(productVersion, string.Empty).PadRight(4, '0');
var version = int.Parse(trimStatus);
var version = int.Parse(trimStatus);
var connection = Db.DbConnection();
var schema = connection.GetSchemaVersion();
@ -181,6 +181,7 @@ namespace PlexRequests.Core
/// <summary>
/// Migrates to version 1.8.
/// <para>This includes updating the admin account to have all roles.</para>
/// <para>Set the log level to info</para>
/// </summary>
private void MigrateToVersion1800()
{
@ -203,6 +204,23 @@ namespace PlexRequests.Core
throw;
}
try
{
var settingsService = new SettingsServiceV2<LogSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
var logSettings = settingsService.GetSettings();
logSettings.Level = LogLevel.Info.Ordinal;
settingsService.SaveSettings(logSettings);
LoggingHelper.ReconfigureLogLevel(LogLevel.FromOrdinal(logSettings.Level));
}
catch (Exception e)
{
Log.Error(e);
throw;
}
}
}
}