mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
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 @@
|
||||
|
||||
namespace NzbDrone.Api.Indexers
|
||||
{
|
||||
class ReleasePushModule : ReleaseModuleBase
|
||||
public class ReleasePushModule : ReleaseModuleBase
|
||||
{
|
||||
private readonly IMakeDownloadDecision _downloadDecisionMaker;
|
||||
private readonly IProcessDownloadDecisions _downloadDecisionProcessor;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace NzbDrone.Api.Profiles
|
||||
{
|
||||
class LegacyProfileModule : NzbDroneApiModule
|
||||
public class LegacyProfileModule : NzbDroneApiModule
|
||||
{
|
||||
public LegacyProfileModule()
|
||||
: base("qualityprofile")
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace NzbDrone.Api.Wanted
|
||||
{
|
||||
class LegacyMissingModule : NzbDroneApiModule
|
||||
public class LegacyMissingModule : NzbDroneApiModule
|
||||
{
|
||||
public LegacyMissingModule() : base("missing")
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ protected ContainerBuilderBase(IStartupContext args, List<string> assemblies)
|
||||
|
||||
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 @@ public static List<PropertyInfo> GetSimpleProperties(this Type type)
|
||||
|
||||
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 @@ public static T[] GetAttributes<T>(this MemberInfo member) where T : Attribute
|
||||
|
||||
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 @@ private static void InitializeEnvironment()
|
||||
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 @@
|
||||
|
||||
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
Block a user