From b751e23e93a0eb8d2cfe6efa19db39e044e025d3 Mon Sep 17 00:00:00 2001 From: Kukks Date: Tue, 12 Dec 2023 13:23:33 +0100 Subject: [PATCH] dont crash if the plugin builder provides more instances of the same plugin but different v --- BTCPayServer/HostedServices/PluginUpdateFetcher.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BTCPayServer/HostedServices/PluginUpdateFetcher.cs b/BTCPayServer/HostedServices/PluginUpdateFetcher.cs index 99aafcee2..ac129fd77 100644 --- a/BTCPayServer/HostedServices/PluginUpdateFetcher.cs +++ b/BTCPayServer/HostedServices/PluginUpdateFetcher.cs @@ -83,7 +83,10 @@ namespace BTCPayServer.HostedServices var installedPlugins = pluginService.LoadedPlugins.ToDictionary(plugin => plugin.Identifier, plugin => plugin.Version); var remotePlugins = await pluginService.GetRemotePlugins(); + //take the latest version of each plugin var remotePluginsList = remotePlugins + .GroupBy(plugin => plugin.Identifier) + .Select(group => group.OrderByDescending(plugin => plugin.Version).First()) .Where(pair => installedPlugins.ContainsKey(pair.Identifier) || disabledPlugins.Contains(pair.Name)) .ToDictionary(plugin => plugin.Identifier, plugin => plugin.Version); var notify = new HashSet();