Used ReflectionOnly and/or public types where possible to avoid loading related assemblies unnecessarily.
This commit is contained in:
parent
9b8ec78502
commit
6a393ef6a2
|
@ -11,7 +11,7 @@ using NzbDrone.Core.Parser.Model;
|
|||
|
||||
namespace NzbDrone.Api.Indexers
|
||||
{
|
||||
class ReleasePushModule : ReleaseModuleBase
|
||||
public class ReleasePushModule : ReleaseModuleBase
|
||||
{
|
||||
private readonly IMakeDownloadDecision _downloadDecisionMaker;
|
||||
private readonly IProcessDownloadDecisions _downloadDecisionProcessor;
|
||||
|
|
|
@ -3,7 +3,7 @@ using Nancy;
|
|||
|
||||
namespace NzbDrone.Api.Profiles
|
||||
{
|
||||
class LegacyProfileModule : NzbDroneApiModule
|
||||
public class LegacyProfileModule : NzbDroneApiModule
|
||||
{
|
||||
public LegacyProfileModule()
|
||||
: base("qualityprofile")
|
||||
|
|
|
@ -3,7 +3,7 @@ using Nancy;
|
|||
|
||||
namespace NzbDrone.Api.Wanted
|
||||
{
|
||||
class LegacyMissingModule : NzbDroneApiModule
|
||||
public class LegacyMissingModule : NzbDroneApiModule
|
||||
{
|
||||
public LegacyMissingModule() : base("missing")
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace NzbDrone.Common.Composition
|
|||
|
||||
foreach (var assembly in assemblies)
|
||||
{
|
||||
_loadedTypes.AddRange(Assembly.Load(assembly).GetTypes());
|
||||
_loadedTypes.AddRange(Assembly.Load(assembly).GetExportedTypes());
|
||||
}
|
||||
|
||||
Container = new Container(new TinyIoCContainer(), _loadedTypes);
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace NzbDrone.Common.Reflection
|
|||
|
||||
public static List<Type> ImplementationsOf<T>(this Assembly assembly)
|
||||
{
|
||||
return assembly.GetTypes().Where(c => typeof(T).IsAssignableFrom(c)).ToList();
|
||||
return assembly.GetExportedTypes().Where(c => typeof(T).IsAssignableFrom(c)).ToList();
|
||||
}
|
||||
|
||||
public static bool IsSimpleType(this Type type)
|
||||
|
@ -67,7 +67,7 @@ namespace NzbDrone.Common.Reflection
|
|||
|
||||
public static Type FindTypeByName(this Assembly assembly, string name)
|
||||
{
|
||||
return assembly.GetTypes().SingleOrDefault(c => c.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
|
||||
return assembly.GetExportedTypes().SingleOrDefault(c => c.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
|
||||
public static bool HasAttribute<TAttribute>(this Type type)
|
||||
|
|
|
@ -40,6 +40,7 @@ namespace NzbDrone.Core.Datastore
|
|||
Environment.SetEnvironmentVariable("No_Expand", "true");
|
||||
Environment.SetEnvironmentVariable("No_SQLiteXmlConfigFile", "true");
|
||||
Environment.SetEnvironmentVariable("No_PreLoadSQLite", "true");
|
||||
Environment.SetEnvironmentVariable("No_SQLiteFunctions", "true");
|
||||
}
|
||||
|
||||
public static void RegisterDatabase(IContainer container)
|
||||
|
|
|
@ -12,7 +12,7 @@ using NzbDrone.Core.Parser.Model;
|
|||
|
||||
namespace Sonarr.Api.V3.Indexers
|
||||
{
|
||||
class ReleasePushModule : ReleaseModuleBase
|
||||
public class ReleasePushModule : ReleaseModuleBase
|
||||
{
|
||||
private readonly IMakeDownloadDecision _downloadDecisionMaker;
|
||||
private readonly IProcessDownloadDecisions _downloadDecisionProcessor;
|
||||
|
|
Loading…
Reference in New Issue