mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 22:17:25 -04:00
Merge pull request #2758 from Bond-009/plugininstalled
Remove PluginInstalled
(cherry picked from commit 0cd7cd611e
)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
ee47a75f9f
commit
f2728b5a92
1 changed files with 0 additions and 36 deletions
|
@ -1016,48 +1016,12 @@ namespace Emby.Server.Implementations
|
||||||
AuthenticatedAttribute.AuthService = AuthService;
|
AuthenticatedAttribute.AuthService = AuthService;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void PluginInstalled(object sender, GenericEventArgs<PackageVersionInfo> args)
|
|
||||||
{
|
|
||||||
string dir = Path.Combine(ApplicationPaths.PluginsPath, args.Argument.name);
|
|
||||||
var types = Directory.EnumerateFiles(dir, "*.dll", SearchOption.AllDirectories)
|
|
||||||
.Select(Assembly.LoadFrom)
|
|
||||||
.SelectMany(x => x.ExportedTypes)
|
|
||||||
.Where(x => x.IsClass && !x.IsAbstract && !x.IsInterface && !x.IsGenericType)
|
|
||||||
.ToArray();
|
|
||||||
|
|
||||||
int oldLen = _allConcreteTypes.Length;
|
|
||||||
Array.Resize(ref _allConcreteTypes, oldLen + types.Length);
|
|
||||||
types.CopyTo(_allConcreteTypes, oldLen);
|
|
||||||
|
|
||||||
var plugins = types.Where(x => x.IsAssignableFrom(typeof(IPlugin)))
|
|
||||||
.Select(CreateInstanceSafe)
|
|
||||||
.Where(x => x != null)
|
|
||||||
.Cast<IPlugin>()
|
|
||||||
.Select(LoadPlugin)
|
|
||||||
.Where(x => x != null)
|
|
||||||
.ToArray();
|
|
||||||
|
|
||||||
oldLen = _plugins.Length;
|
|
||||||
Array.Resize(ref _plugins, oldLen + plugins.Length);
|
|
||||||
plugins.CopyTo(_plugins, oldLen);
|
|
||||||
|
|
||||||
var entries = types.Where(x => x.IsAssignableFrom(typeof(IServerEntryPoint)))
|
|
||||||
.Select(CreateInstanceSafe)
|
|
||||||
.Where(x => x != null)
|
|
||||||
.Cast<IServerEntryPoint>()
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
await Task.WhenAll(StartEntryPoints(entries, true)).ConfigureAwait(false);
|
|
||||||
await Task.WhenAll(StartEntryPoints(entries, false)).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds the parts.
|
/// Finds the parts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void FindParts()
|
public void FindParts()
|
||||||
{
|
{
|
||||||
InstallationManager = ServiceProvider.GetService<IInstallationManager>();
|
InstallationManager = ServiceProvider.GetService<IInstallationManager>();
|
||||||
InstallationManager.PluginInstalled += PluginInstalled;
|
|
||||||
|
|
||||||
if (!ServerConfigurationManager.Configuration.IsPortAuthorized)
|
if (!ServerConfigurationManager.Configuration.IsPortAuthorized)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue