Browse Source

Add logging, cleanup

David 4 years ago
parent
commit
d296a1f6d0
1 changed files with 5 additions and 16 deletions
  1. 5 16
      Emby.Server.Implementations/ApplicationHost.cs

+ 5 - 16
Emby.Server.Implementations/ApplicationHost.cs

@@ -1387,25 +1387,14 @@ namespace Emby.Server.Implementations
 
         public IEnumerable<Assembly> GetApiPluginAssemblies()
         {
-            var assemblies = new List<Assembly>();
-            try
-            {
-                var types = _allConcreteTypes
-                    .Where(i => typeof(ControllerBase).IsAssignableFrom(i))
-                    // .Select(i => ActivatorUtilities.CreateInstance(ServiceProvider, i))
-                    .ToArray();
+            var types = _allConcreteTypes
+                .Where(i => typeof(ControllerBase).IsAssignableFrom(i));
 
-                foreach (var variable in types)
-                {
-                    assemblies.Add(variable.Assembly);
-                }
-            }
-            catch (Exception ex)
+            foreach (var type in types)
             {
-                // ignore
+                Logger.LogDebug("Found API endpoints in plugin " + type.Assembly.FullName);
+                yield return type.Assembly;
             }
-
-            return assemblies;
         }
 
         public virtual void LaunchUrl(string url)