aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/ApplicationHost.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-12-29 09:12:29 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-12-29 09:12:29 -0500
commit3488cfecbd54eaaf917d853664f68cac84d472e9 (patch)
treea3f05e3f05e0441ae775b544d1b983a93ea49887 /MediaBrowser.ServerApplication/ApplicationHost.cs
parente19766b1b7e4735e18ebb0e997579f7671cc267c (diff)
make lazy loaded paths more nimble
Diffstat (limited to 'MediaBrowser.ServerApplication/ApplicationHost.cs')
-rw-r--r--MediaBrowser.ServerApplication/ApplicationHost.cs22
1 files changed, 19 insertions, 3 deletions
diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs
index 00db91f41..935067a33 100644
--- a/MediaBrowser.ServerApplication/ApplicationHost.cs
+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs
@@ -542,9 +542,7 @@ namespace MediaBrowser.ServerApplication
/// <returns>IEnumerable{Assembly}.</returns>
protected override IEnumerable<Assembly> GetComposablePartAssemblies()
{
- var list = Directory.EnumerateFiles(ApplicationPaths.PluginsPath, "*.dll", SearchOption.TopDirectoryOnly)
- .Select(LoadAssembly)
- .Where(a => a != null)
+ var list = GetPluginAssemblies()
.ToList();
// Gets all plugin assemblies by first reading all bytes of the .dll and calling Assembly.Load against that
@@ -582,6 +580,24 @@ namespace MediaBrowser.ServerApplication
return list;
}
+ /// <summary>
+ /// Gets the plugin assemblies.
+ /// </summary>
+ /// <returns>IEnumerable{Assembly}.</returns>
+ private IEnumerable<Assembly> GetPluginAssemblies()
+ {
+ try
+ {
+ return Directory.EnumerateFiles(ApplicationPaths.PluginsPath, "*.dll", SearchOption.TopDirectoryOnly)
+ .Select(LoadAssembly)
+ .Where(a => a != null);
+ }
+ catch (DirectoryNotFoundException)
+ {
+ return new List<Assembly>();
+ }
+ }
+
private readonly string _systemId = Environment.MachineName.GetMD5().ToString();
/// <summary>