Merge pull request #5380 from Bond-009/plugins

100% branch coverage for DashboardController
pull/5385/head
Bond-009 4 years ago committed by GitHub
commit e839929b91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Plugins
private readonly ILogger<PluginManager> _logger; private readonly ILogger<PluginManager> _logger;
private readonly IApplicationHost _appHost; private readonly IApplicationHost _appHost;
private readonly ServerConfiguration _config; private readonly ServerConfiguration _config;
private readonly IList<LocalPlugin> _plugins; private readonly List<LocalPlugin> _plugins;
private readonly Version _minimumVersion; private readonly Version _minimumVersion;
private IHttpClientFactory? _httpClientFactory; private IHttpClientFactory? _httpClientFactory;
@ -94,7 +94,7 @@ namespace Emby.Server.Implementations.Plugins
/// <summary> /// <summary>
/// Gets the Plugins. /// Gets the Plugins.
/// </summary> /// </summary>
public IList<LocalPlugin> Plugins => _plugins; public IReadOnlyList<LocalPlugin> Plugins => _plugins;
/// <summary> /// <summary>
/// Returns all the assemblies. /// Returns all the assemblies.

@ -95,9 +95,9 @@ namespace Jellyfin.Api.Controllers
return GetPluginPages(plugin).Select(i => new ConfigurationPageInfo(plugin.Instance, i.Item1)); return GetPluginPages(plugin).Select(i => new ConfigurationPageInfo(plugin.Instance, i.Item1));
} }
private IEnumerable<Tuple<PluginPageInfo, IPlugin>> GetPluginPages(LocalPlugin? plugin) private IEnumerable<Tuple<PluginPageInfo, IPlugin>> GetPluginPages(LocalPlugin plugin)
{ {
if (plugin?.Instance is not IHasWebPages hasWebPages) if (plugin.Instance is not IHasWebPages hasWebPages)
{ {
return Enumerable.Empty<Tuple<PluginPageInfo, IPlugin>>(); return Enumerable.Empty<Tuple<PluginPageInfo, IPlugin>>();
} }

@ -17,7 +17,7 @@ namespace MediaBrowser.Common.Plugins
/// <summary> /// <summary>
/// Gets the Plugins. /// Gets the Plugins.
/// </summary> /// </summary>
IList<LocalPlugin> Plugins { get; } IReadOnlyList<LocalPlugin> Plugins { get; }
/// <summary> /// <summary>
/// Creates the plugins. /// Creates the plugins.

Loading…
Cancel
Save