mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
dont crash if the plugin builder provides more instances of the same plugin but different v
This commit is contained in:
parent
72ee65843d
commit
b751e23e93
1 changed files with 3 additions and 0 deletions
|
@ -83,7 +83,10 @@ namespace BTCPayServer.HostedServices
|
||||||
var installedPlugins =
|
var installedPlugins =
|
||||||
pluginService.LoadedPlugins.ToDictionary(plugin => plugin.Identifier, plugin => plugin.Version);
|
pluginService.LoadedPlugins.ToDictionary(plugin => plugin.Identifier, plugin => plugin.Version);
|
||||||
var remotePlugins = await pluginService.GetRemotePlugins();
|
var remotePlugins = await pluginService.GetRemotePlugins();
|
||||||
|
//take the latest version of each plugin
|
||||||
var remotePluginsList = remotePlugins
|
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))
|
.Where(pair => installedPlugins.ContainsKey(pair.Identifier) || disabledPlugins.Contains(pair.Name))
|
||||||
.ToDictionary(plugin => plugin.Identifier, plugin => plugin.Version);
|
.ToDictionary(plugin => plugin.Identifier, plugin => plugin.Version);
|
||||||
var notify = new HashSet<string>();
|
var notify = new HashSet<string>();
|
||||||
|
|
Loading…
Add table
Reference in a new issue