autoupdate: print updated plugins in chat

This commit is contained in:
goat 2024-07-08 19:35:45 +02:00
parent 34a51d0119
commit 77abd0455d

View file

@ -322,7 +322,8 @@ internal class AutoUpdateManager : IServiceType
notification.Progress = (float)updateProgress.PluginsProcessed / updateProgress.TotalPlugins; notification.Progress = (float)updateProgress.PluginsProcessed / updateProgress.TotalPlugins;
}; };
var pluginStates = await this.pluginManager.UpdatePluginsAsync(updatablePlugins, this.isDryRun.Value, true, progress); var pluginStates = (await this.pluginManager.UpdatePluginsAsync(updatablePlugins, this.isDryRun.Value, true, progress)).ToList();
this.pluginManager.PrintUpdatedPlugins(pluginStates, Loc.Localize("DalamudPluginAutoUpdate", "The following plugins were auto-updated:"));
notification.Progress = 1; notification.Progress = 1;
notification.UserDismissable = true; notification.UserDismissable = true;
@ -335,8 +336,7 @@ internal class AutoUpdateManager : IServiceType
}; };
// Update the notification to show the final state // Update the notification to show the final state
var pluginUpdateStatusEnumerable = pluginStates as PluginUpdateStatus[] ?? pluginStates.ToArray(); if (pluginStates.All(x => x.Status == PluginUpdateStatus.StatusKind.Success))
if (pluginUpdateStatusEnumerable.All(x => x.Status == PluginUpdateStatus.StatusKind.Success))
{ {
notification.Minimized = true; notification.Minimized = true;
@ -355,7 +355,7 @@ internal class AutoUpdateManager : IServiceType
notification.Type = NotificationType.Error; notification.Type = NotificationType.Error;
notification.Content = Locs.NotificationContentUpdatesFailed; notification.Content = Locs.NotificationContentUpdatesFailed;
var failedPlugins = pluginUpdateStatusEnumerable var failedPlugins = pluginStates
.Where(x => x.Status != PluginUpdateStatus.StatusKind.Success) .Where(x => x.Status != PluginUpdateStatus.StatusKind.Success)
.Select(x => x.Name).ToList(); .Select(x => x.Name).ToList();