Skip to content

Commit

Permalink
Fix issue #235 Possible error loading/writing settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas694 committed Apr 19, 2022
1 parent 02ba1e6 commit f220b82
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,21 @@ public async void Run()
await Dispatcher.CurrentDispatcher.InvokeAsync(ManagerController.RestoreColumn, DispatcherPriority.ApplicationIdle);
await Dispatcher.CurrentDispatcher.InvokeAsync(QueueController.Run, DispatcherPriority.ApplicationIdle);

if (await CheckFor64BitVersion()) return;
if (await CheckFor64BitVersion())
{
_appSettings.TMLastCheck = DateTime.MinValue.ToUniversalTime();
return;
}

if (_appSettings.LastUpdateCheck != DateTime.Today)
{
var executingUpdate = await CheckForUpdatesComplete(_applicationUpdateService.GetLatestReleaseFromServer());
_appSettings.LastUpdateCheck = DateTime.Today;
if (executingUpdate) return;
if (executingUpdate)
{
_appSettings.TMLastCheck = DateTime.MinValue.ToUniversalTime();
return;
}
}

await CheckForTMData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,11 @@ public static bool Upgrade(AppSettings settings)
settings.LastUpdateCheck = new DateTime(1970, 1, 1);
updated = true;
}
if (settings.TMLastCheck == new DateTime(1, 1, 1))
{
settings.TMLastCheck = new DateTime(1970, 1, 1);
updated = true;
}

if (settings.ColumnSettings.Count > 0 && settings.ColumnSettings.ContainsKey("Date Added"))
{
Expand Down Expand Up @@ -593,6 +598,7 @@ private void Initialize()
GroupPhotoSets = false;
FilenameTemplate = "%f";
LastUpdateCheck = new DateTime(1970, 1, 1);
TMLastCheck = new DateTime(1970, 1, 1);
Language = "en-US";
ColumnSettings = new Dictionary<object, Tuple<int, double, Visibility>>();
}
Expand Down

0 comments on commit f220b82

Please sign in to comment.