This commit is contained in:
tidusjar 2016-08-09 14:03:48 +01:00
commit 632ce75fa0
7 changed files with 84 additions and 22 deletions

View file

@ -184,15 +184,25 @@ namespace PlexRequests.Core
var plexSettings = new SettingsServiceV2<PlexSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
var currentSettings = plexSettings.GetSettings();
if (!string.IsNullOrEmpty(auth.OldPlexAuthToken))
if (!string.IsNullOrEmpty(auth?.OldPlexAuthToken))
{
currentSettings.PlexAuthToken = auth.OldPlexAuthToken;
currentSettings.PlexAuthToken = auth?.OldPlexAuthToken;
plexSettings.SaveSettings(currentSettings);
// Clear out the old value
auth.OldPlexAuthToken = string.Empty;
authSettings.SaveSettings(auth);
}
//If we have an authToken we do not need to go through the setup
if (!string.IsNullOrEmpty(auth?.OldPlexAuthToken))
{
var prServuce = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
var settings = prServuce.GetSettings();
settings.Wizard = true;
prServuce.SaveSettings(settings);
}
}
/// <summary>