diff options
| author | crobibero <cody@robibe.ro> | 2021-05-27 06:07:57 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2021-05-27 06:07:57 -0600 |
| commit | 01e8ff8ddf84ac033a00917664482f67572e0f9b (patch) | |
| tree | 288ad75a0413995442eddf0e78d0c3bb72139456 /Emby.Server.Implementations/Plugins/PluginManager.cs | |
| parent | 78791a932f4a83834c1fb58e28a94cce6c8f349c (diff) | |
| parent | 75704effaed91456bf6e4d46f7d6c7145bcdec5f (diff) | |
Merge remote-tracking branch 'upstream/master' into healthy-base-url
Diffstat (limited to 'Emby.Server.Implementations/Plugins/PluginManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Plugins/PluginManager.cs | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs index 3a8296455..48281b75f 100644 --- a/Emby.Server.Implementations/Plugins/PluginManager.cs +++ b/Emby.Server.Implementations/Plugins/PluginManager.cs @@ -1,5 +1,3 @@ -#nullable enable - using System; using System.Collections.Generic; using System.Globalization; @@ -44,12 +42,7 @@ namespace Emby.Server.Implementations.Plugins { get { - if (_httpClientFactory == null) - { - _httpClientFactory = _appHost.Resolve<IHttpClientFactory>(); - } - - return _httpClientFactory; + return _httpClientFactory ?? (_httpClientFactory = _appHost.Resolve<IHttpClientFactory>()); } } @@ -166,9 +159,7 @@ namespace Emby.Server.Implementations.Plugins /// </summary> public void CreatePlugins() { - _ = _appHost.GetExports<IPlugin>(CreatePluginInstance) - .Where(i => i != null) - .ToArray(); + _ = _appHost.GetExports<IPlugin>(CreatePluginInstance); } /// <summary> @@ -278,11 +269,7 @@ namespace Emby.Server.Implementations.Plugins // If no version is given, return the current instance. var plugins = _plugins.Where(p => p.Id.Equals(id)).ToList(); - plugin = plugins.FirstOrDefault(p => p.Instance != null); - if (plugin == null) - { - plugin = plugins.OrderByDescending(p => p.Version).FirstOrDefault(); - } + plugin = plugins.FirstOrDefault(p => p.Instance != null) ?? plugins.OrderByDescending(p => p.Version).FirstOrDefault(); } else { |
