From cf0858db7c83987d921366abd2df0d472d80fbba Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Wed, 13 Mar 2024 22:39:39 -0500 Subject: [PATCH] Fix outdated client message when up to date --- Core/Repositories/RepositoryData.cs | 5 ++++- GUI/Main/Main.cs | 27 +++++++++++---------------- GUI/Main/MainAutoUpdate.cs | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Core/Repositories/RepositoryData.cs b/Core/Repositories/RepositoryData.cs index 54e7f718d..e6ef66240 100644 --- a/Core/Repositories/RepositoryData.cs +++ b/Core/Repositories/RepositoryData.cs @@ -288,7 +288,10 @@ private static ArchiveList AggregateArchiveEntries(ParallelQuery e subtotal.Item2 ?? item.Item2, subtotal.Item3 ?? item.Item3, subtotal.Item4 ?? item.Item4, - subtotal.Item5 || item.Item1 == null), + subtotal.Item5 || (item.Item1 == null + && item.Item2 == null + && item.Item3 == null + && item.Item4 == null)), (total, subtotal) => new ArchiveList(total.Item1.Concat(subtotal.Item1).ToList(), total.Item2 ?? subtotal.Item2, diff --git a/GUI/Main/Main.cs b/GUI/Main/Main.cs index 12202dcc8..cc440a82a 100644 --- a/GUI/Main/Main.cs +++ b/GUI/Main/Main.cs @@ -418,33 +418,28 @@ private void CurrentInstanceUpdated() configuration?.Save(); configuration = GUIConfigForInstance(Manager.SteamLibrary, CurrentInstance); - AutoUpdatePrompts(ServiceLocator.Container - .Resolve(), - configuration); - - bool autoUpdating = configuration.CheckForUpdatesOnLaunch - && CheckForCKANUpdate(); - if (autoUpdating) - { - UpdateCKAN(); - } - var pluginsPath = Path.Combine(CurrentInstance.CkanDir(), "Plugins"); if (!Directory.Exists(pluginsPath)) { Directory.CreateDirectory(pluginsPath); } - pluginController = new PluginController(pluginsPath, true); CurrentInstance.game.RebuildSubdirectories(CurrentInstance.GameDir()); ManageMods.InstanceUpdated(); - bool repoUpdateNeeded = configuration.RefreshOnStartup; - if (!autoUpdating) + + AutoUpdatePrompts(ServiceLocator.Container + .Resolve(), + configuration); + + if (configuration.CheckForUpdatesOnLaunch && CheckForCKANUpdate()) + { + UpdateCKAN(); + } + else { - // If not allowing, don't do anything - if (repoUpdateNeeded) + if (configuration.RefreshOnStartup) { UpdateRepo(refreshWithoutChanges: true); } diff --git a/GUI/Main/MainAutoUpdate.cs b/GUI/Main/MainAutoUpdate.cs index c483104f3..170fe2a2f 100644 --- a/GUI/Main/MainAutoUpdate.cs +++ b/GUI/Main/MainAutoUpdate.cs @@ -85,7 +85,7 @@ public void UpdateCKAN() var mainConfig = ServiceLocator.Container.Resolve(); var update = updater.GetUpdate(mainConfig.DevBuilds ?? false); Wait.SetDescription(string.Format(Properties.Resources.MainUpgradingTo, - update.Version)); + update.Version)); log.Info("Starting CKAN update"); Wait.StartWaiting((sender, args) => updater.StartUpdateProcess(true, mainConfig.DevBuilds ?? false, currentUser),