diff options
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/Plugins/PluginManager.cs | 13 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Updates/InstallationManager.cs | 5 |
2 files changed, 10 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs index 944b746528..26a029f712 100644 --- a/Emby.Server.Implementations/Plugins/PluginManager.cs +++ b/Emby.Server.Implementations/Plugins/PluginManager.cs @@ -212,12 +212,13 @@ namespace Emby.Server.Implementations /// <summary> /// Attempts to find the plugin with and id of <paramref name="id"/>. /// </summary> - /// <param name="id">Id of plugin.</param> - /// <param name="version">The version of the plugin to locate.</param> - /// <param name="plugin">A <see cref="LocalPlugin"/> if found, otherwise null.</param> - /// <returns>Boolean value signifying the success of the search.</returns> - public bool TryGetPlugin(Guid id, Version? version, out LocalPlugin? plugin) + /// <param name="id">The <see cref="Guid"/> of plugin.</param> + /// <param name="version">Optional <see cref="Version"/> of the plugin to locate.</param> + /// <returns>A <see cref="LocalPlugin"/> if located, or null if not.</returns> + public LocalPlugin? GetPlugin(Guid id, Version? version = null) { + LocalPlugin? plugin; + if (version == null) { // If no version is given, return the current instance. @@ -235,7 +236,7 @@ namespace Emby.Server.Implementations plugin = _plugins.FirstOrDefault(p => p.Id.Equals(id) && p.Version.Equals(version)); } - return plugin != null; + return plugin; } /// <summary> diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index fc80bdd756..7cab77c85d 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -197,10 +197,11 @@ namespace Emby.Server.Implementations.Updates { var version = package.Versions[i]; + var plugin = _pluginManager.GetPlugin(packageGuid, version.VersionNumber); // Update the manifests, if anything changes. - if (_pluginManager.TryGetPlugin(packageGuid, version.VersionNumber, out LocalPlugin? plugin)) + if (plugin != null) { - bool noChange = string.Equals(plugin!.Manifest.MaxAbi, version.MaxAbi, StringComparison.Ordinal) + bool noChange = string.Equals(plugin.Manifest.MaxAbi, version.MaxAbi, StringComparison.Ordinal) || string.Equals(plugin.Manifest.TargetAbi, version.TargetAbi, StringComparison.Ordinal); if (!noChange) { |
