2018-04-21 04:59:31 +00:00
|
|
|
using System.Collections.Generic;
|
2014-01-06 06:20:08 +00:00
|
|
|
using Nancy.Bootstrapper;
|
2018-11-23 07:03:32 +00:00
|
|
|
using Radarr.Http;
|
2013-05-10 23:53:50 +00:00
|
|
|
using NzbDrone.Common.Composition;
|
2013-07-09 00:47:09 +00:00
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
2013-09-11 06:33:47 +00:00
|
|
|
using NzbDrone.SignalR;
|
2013-04-20 00:05:48 +00:00
|
|
|
|
2017-01-05 19:42:02 +00:00
|
|
|
namespace Radarr.Host
|
2013-04-20 00:05:48 +00:00
|
|
|
{
|
|
|
|
public class MainAppContainerBuilder : ContainerBuilderBase
|
|
|
|
{
|
2013-11-26 06:53:36 +00:00
|
|
|
public static IContainer BuildContainer(StartupContext args)
|
2013-04-20 00:05:48 +00:00
|
|
|
{
|
2015-10-03 17:45:26 +00:00
|
|
|
var assemblies = new List<string>
|
2014-01-06 06:20:08 +00:00
|
|
|
{
|
2017-01-05 19:42:02 +00:00
|
|
|
"Radarr.Host",
|
2018-11-23 07:03:32 +00:00
|
|
|
"Radarr.Core",
|
|
|
|
"Radarr.Api",
|
|
|
|
"Radarr.SignalR",
|
|
|
|
"Radarr.Api.V2",
|
|
|
|
"Radarr.Http"
|
2014-01-06 06:20:08 +00:00
|
|
|
};
|
|
|
|
|
2018-04-21 04:59:31 +00:00
|
|
|
return new MainAppContainerBuilder(args, assemblies).Container;
|
2013-04-20 00:05:48 +00:00
|
|
|
}
|
|
|
|
|
2018-04-21 04:59:31 +00:00
|
|
|
private MainAppContainerBuilder(StartupContext args, List<string> assemblies)
|
2014-01-06 06:20:08 +00:00
|
|
|
: base(args, assemblies)
|
2013-04-20 00:05:48 +00:00
|
|
|
{
|
2019-10-14 20:21:00 +00:00
|
|
|
AutoRegisterImplementations<MessageHub>();
|
2013-04-20 00:05:48 +00:00
|
|
|
|
2018-11-23 07:03:32 +00:00
|
|
|
Container.Register<INancyBootstrapper, RadarrBootstrapper>();
|
2019-10-14 20:21:00 +00:00
|
|
|
|
|
|
|
if (OsInfo.IsWindows)
|
|
|
|
{
|
|
|
|
Container.Register<INzbDroneServiceFactory, NzbDroneServiceFactory>();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Container.Register<INzbDroneServiceFactory, DummyNzbDroneServiceFactory>();
|
|
|
|
}
|
2013-07-09 00:47:09 +00:00
|
|
|
}
|
2013-04-20 00:05:48 +00:00
|
|
|
}
|
2018-04-21 04:59:31 +00:00
|
|
|
}
|