diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index 50405778b..821a01ee7 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -159,14 +159,7 @@ namespace Dalamud.Plugin.Internal .Select(repo => new PluginRepository(repo.Url, repo.IsEnabled))); this.Repos = repos; - - if (notify) - this.NotifyAvailablePluginsChanged(); - - foreach (var repo in repos) - { - await repo.ReloadPluginMasterAsync(); - } + await this.ReloadPluginMastersAsync(notify); } /// @@ -306,21 +299,20 @@ namespace Dalamud.Plugin.Internal /// /// Reload the PluginMaster for each repo, filter, and event that the list has updated. /// + /// Whether to notify that available plugins have changed afterwards. /// A representing the asynchronous operation. - public async Task ReloadPluginMastersAsync() + public async Task ReloadPluginMastersAsync(bool notify = true) { - foreach (var repo in this.Repos) - { - await repo.ReloadPluginMasterAsync(); - } + await Task.WhenAll(this.Repos.Select(repo => repo.ReloadPluginMasterAsync())); - this.RefilterPluginMasters(); + this.RefilterPluginMasters(notify); } /// /// Apply visibility and eligibility filters to the available plugins, then event that the list has updated. /// - public void RefilterPluginMasters() + /// Whether to notify that available plugins have changed afterwards. + public void RefilterPluginMasters(bool notify = true) { this.availablePlugins = this.Repos .SelectMany(repo => repo.PluginMaster) @@ -328,7 +320,10 @@ namespace Dalamud.Plugin.Internal .Where(this.IsManifestVisible) .ToList(); - this.NotifyAvailablePluginsChanged(); + if (notify) + { + this.NotifyAvailablePluginsChanged(); + } } ///