|
|
|
@ -53,6 +53,7 @@ namespace Radarr.Host
|
|
|
|
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
|
|
|
|
|
|
|
|
|
var appMode = GetApplicationMode(startupContext);
|
|
|
|
|
var config = GetConfiguration(startupContext);
|
|
|
|
|
|
|
|
|
|
switch (appMode)
|
|
|
|
|
{
|
|
|
|
@ -81,12 +82,22 @@ namespace Radarr.Host
|
|
|
|
|
// Utility mode
|
|
|
|
|
default:
|
|
|
|
|
{
|
|
|
|
|
new Container(rules => rules.WithNzbDroneRules())
|
|
|
|
|
.AutoAddServices(ASSEMBLIES)
|
|
|
|
|
.AddNzbDroneLogger()
|
|
|
|
|
.AddStartupContext(startupContext)
|
|
|
|
|
.Resolve<UtilityModeRouter>()
|
|
|
|
|
.Route(appMode);
|
|
|
|
|
new HostBuilder()
|
|
|
|
|
.UseServiceProviderFactory(new DryIocServiceProviderFactory(new Container(rules => rules.WithNzbDroneRules())))
|
|
|
|
|
.ConfigureContainer<IContainer>(c =>
|
|
|
|
|
{
|
|
|
|
|
c.AutoAddServices(Bootstrap.ASSEMBLIES)
|
|
|
|
|
.AddNzbDroneLogger()
|
|
|
|
|
.AddDatabase()
|
|
|
|
|
.AddStartupContext(startupContext)
|
|
|
|
|
.Resolve<UtilityModeRouter>()
|
|
|
|
|
.Route(appMode);
|
|
|
|
|
})
|
|
|
|
|
.ConfigureServices(services =>
|
|
|
|
|
{
|
|
|
|
|
services.Configure<PostgresOptions>(config.GetSection("Radarr:Postgres"));
|
|
|
|
|
}).Build();
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|