From 1f2ecd0775f291457e780733339bb5009ebb8408 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Tue, 22 Dec 2020 15:01:26 +0000 Subject: [PATCH] Fix for DI. --- Emby.Server.Implementations/Plugins/PluginManager.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs index 33faa5e9d8..fbb092a7c6 100644 --- a/Emby.Server.Implementations/Plugins/PluginManager.cs +++ b/Emby.Server.Implementations/Plugins/PluginManager.cs @@ -140,7 +140,7 @@ namespace Emby.Server.Implementations.Plugins { foreach (var pluginServiceRegistrator in _appHost.GetExportTypes()) { - var plugin = GetPluginByType(pluginServiceRegistrator.Assembly.GetType()); + var plugin = GetPluginByAssembly(pluginServiceRegistrator.Assembly); if (plugin == null) { _logger.LogError("Unable to find plugin in assembly {Assembly}", pluginServiceRegistrator.Assembly.FullName); @@ -350,14 +350,14 @@ namespace Emby.Server.Implementations.Plugins } /// - /// Finds the plugin record using the type. + /// Finds the plugin record using the assembly. /// - /// The being sought. + /// The being sought. /// The matching record, or null if not found. - private LocalPlugin? GetPluginByType(Type type) + private LocalPlugin? GetPluginByAssembly(Assembly assembly) { // Find which plugin it is by the path. - return _plugins.FirstOrDefault(p => string.Equals(p.Path, Path.GetDirectoryName(type.Assembly.Location), StringComparison.Ordinal)); + return _plugins.FirstOrDefault(p => string.Equals(p.Path, Path.GetDirectoryName(assembly.Location), StringComparison.Ordinal)); } /// @@ -368,7 +368,7 @@ namespace Emby.Server.Implementations.Plugins private IPlugin? CreatePluginInstance(Type type) { // Find the record for this plugin. - var plugin = GetPluginByType(type); + var plugin = GetPluginByAssembly(type.Assembly); if (plugin?.Manifest.Status < PluginStatus.Active) { return null;