Hello Autofac, Goodbye Ninject

This commit is contained in:
Mark McDowall 2013-01-02 17:09:13 -08:00
parent 17d9d0cc4f
commit 924d3d0c8e
139 changed files with 473 additions and 572 deletions

View File

@ -3,11 +3,10 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Web; using System.Web;
using Autofac;
using Funq; using Funq;
using Ninject;
using NzbDrone.Api.QualityProfiles; using NzbDrone.Api.QualityProfiles;
using NzbDrone.Api.QualityType; using NzbDrone.Api.QualityType;
using ServiceStack.ContainerAdapter.Ninject;
using ServiceStack.WebHost.Endpoints; using ServiceStack.WebHost.Endpoints;
using QualityProfileService = NzbDrone.Api.QualityProfiles.QualityProfileService; using QualityProfileService = NzbDrone.Api.QualityProfiles.QualityProfileService;
@ -15,17 +14,17 @@ namespace NzbDrone.Api
{ {
public class AppHost : AppHostBase public class AppHost : AppHostBase
{ {
private IKernel _kernel; private IContainer _container;
public AppHost(IKernel kernel) //Tell ServiceStack the name and where to find your web services public AppHost(IContainer container) //Tell ServiceStack the name and where to find your web services
: base("NzbDrone API", typeof(QualityProfileService).Assembly) : base("NzbDrone API", typeof(QualityProfileService).Assembly)
{ {
_kernel = kernel; _container = container;
} }
public override void Configure(Container container) public override void Configure(Container container)
{ {
container.Adapter = new NinjectContainerAdapter(_kernel); container.Adapter = new AutofacIocAdapter(_container);
SetConfig(new EndpointHostConfig { ServiceStackHandlerFactoryPath = "api" }); SetConfig(new EndpointHostConfig { ServiceStackHandlerFactoryPath = "api" });
Routes Routes

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autofac;
using ServiceStack.Configuration;
namespace NzbDrone.Api
{
public class AutofacIocAdapter : IContainerAdapter
{
private readonly IContainer _container;
public AutofacIocAdapter(IContainer container)
{
_container = container;
}
public T Resolve<T>()
{
return _container.Resolve<T>();
}
public T TryResolve<T>()
{
T result;
if (_container.TryResolve<T>(out result))
{
return result;
}
return default(T);
}
}
}

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Ninject;
using NzbDrone.Api.Exceptions; using NzbDrone.Api.Exceptions;
using NzbDrone.Api.Helpers; using NzbDrone.Api.Helpers;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -16,7 +15,6 @@ namespace NzbDrone.Api.Filters
public ApplyTo ApplyTo { get; set; } public ApplyTo ApplyTo { get; set; }
public int Priority { get; set; } public int Priority { get; set; }
[Inject]
public ConfigProvider _configProvider; public ConfigProvider _configProvider;
public void RequestFilter(IHttpRequest req, IHttpResponse res, object requestDto) public void RequestFilter(IHttpRequest req, IHttpResponse res, object requestDto)

View File

@ -50,22 +50,21 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Autofac">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll</HintPath>
</Reference>
<Reference Include="Autofac.Configuration">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.Configuration.dll</HintPath>
</Reference>
<Reference Include="AutoMapper"> <Reference Include="AutoMapper">
<HintPath>..\packages\AutoMapper.2.2.0\lib\net40\AutoMapper.dll</HintPath> <HintPath>..\packages\AutoMapper.2.2.0\lib\net40\AutoMapper.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ninject, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll</HintPath>
</Reference>
<Reference Include="ServiceStack"> <Reference Include="ServiceStack">
<HintPath>..\packages\ServiceStack.3.9.25\lib\net35\ServiceStack.dll</HintPath> <HintPath>..\packages\ServiceStack.3.9.25\lib\net35\ServiceStack.dll</HintPath>
</Reference> </Reference>
<Reference Include="ServiceStack.Common"> <Reference Include="ServiceStack.Common">
<HintPath>..\packages\ServiceStack.Common.3.9.25\lib\net35\ServiceStack.Common.dll</HintPath> <HintPath>..\packages\ServiceStack.Common.3.9.25\lib\net35\ServiceStack.Common.dll</HintPath>
</Reference> </Reference>
<Reference Include="ServiceStack.ContainerAdapter.Ninject">
<HintPath>..\packages\ServiceStack.ContainerAdapter.Ninject.1.0.4526.38581\lib\net40\ServiceStack.ContainerAdapter.Ninject.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Interfaces"> <Reference Include="ServiceStack.Interfaces">
<HintPath>..\packages\ServiceStack.Common.3.9.25\lib\net35\ServiceStack.Interfaces.dll</HintPath> <HintPath>..\packages\ServiceStack.Common.3.9.25\lib\net35\ServiceStack.Interfaces.dll</HintPath>
</Reference> </Reference>
@ -94,6 +93,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AppHost.cs" /> <Compile Include="AppHost.cs" />
<Compile Include="AutofacContainerAdapter.cs" />
<Compile Include="Bootstrapper.cs" /> <Compile Include="Bootstrapper.cs" />
<Compile Include="Exceptions\InvalidApiKeyException.cs" /> <Compile Include="Exceptions\InvalidApiKeyException.cs" />
<Compile Include="Filters\ValidApiRequestAttribute.cs" /> <Compile Include="Filters\ValidApiRequestAttribute.cs" />

View File

@ -1,7 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using AutoMapper; using AutoMapper;
using Ninject;
using NzbDrone.Api.Filters; using NzbDrone.Api.Filters;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Repository.Quality;
@ -14,7 +13,6 @@ namespace NzbDrone.Api.QualityProfiles
{ {
private readonly QualityProvider _qualityProvider; private readonly QualityProvider _qualityProvider;
[Inject]
public QualityProfileService(QualityProvider qualityProvider) public QualityProfileService(QualityProvider qualityProvider)
{ {
_qualityProvider = qualityProvider; _qualityProvider = qualityProvider;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using AutoMapper; using AutoMapper;
using Ninject;
using NzbDrone.Api.Filters; using NzbDrone.Api.Filters;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using ServiceStack.ServiceInterface; using ServiceStack.ServiceInterface;
@ -14,7 +13,6 @@ namespace NzbDrone.Api.QualityType
{ {
private readonly QualityTypeProvider _qualityTypeProvider; private readonly QualityTypeProvider _qualityTypeProvider;
[Inject]
public QualityTypeService(QualityTypeProvider qualityTypeProvider) public QualityTypeService(QualityTypeProvider qualityTypeProvider)
{ {
_qualityTypeProvider = qualityTypeProvider; _qualityTypeProvider = qualityTypeProvider;

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Autofac" version="2.6.3.862" targetFramework="net40" />
<package id="AutoMapper" version="2.2.0" targetFramework="net40" /> <package id="AutoMapper" version="2.2.0" targetFramework="net40" />
<package id="Ninject" version="3.0.1.10" targetFramework="net40" />
<package id="ServiceStack" version="3.9.25" targetFramework="net40" /> <package id="ServiceStack" version="3.9.25" targetFramework="net40" />
<package id="ServiceStack.Common" version="3.9.25" targetFramework="net40" /> <package id="ServiceStack.Common" version="3.9.25" targetFramework="net40" />
<package id="ServiceStack.ContainerAdapter.Ninject" version="1.0.4526.38581" targetFramework="net40" />
<package id="ServiceStack.OrmLite.SqlServer" version="3.9.26" targetFramework="net40" /> <package id="ServiceStack.OrmLite.SqlServer" version="3.9.26" targetFramework="net40" />
<package id="ServiceStack.Redis" version="3.9.25" targetFramework="net40" /> <package id="ServiceStack.Redis" version="3.9.25" targetFramework="net40" />
<package id="ServiceStack.Text" version="3.9.27" targetFramework="net40" /> <package id="ServiceStack.Text" version="3.9.27" targetFramework="net40" />

View File

@ -1,6 +1,6 @@
using FluentAssertions; using Autofac;
using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using Ninject;
using NzbDrone.Test.Common; using NzbDrone.Test.Common;
namespace NzbDrone.App.Test namespace NzbDrone.App.Test
@ -11,14 +11,14 @@ namespace NzbDrone.App.Test
[Test] [Test]
public void Kernel_can_get_kernel() public void Kernel_can_get_kernel()
{ {
CentralDispatch.Kernel.Should().NotBeNull(); CentralDispatch.Container.Should().NotBeNull();
} }
[Test] [Test]
public void Kernel_should_return_same_kernel() public void Kernel_should_return_same_kernel()
{ {
var firstKernel = CentralDispatch.Kernel; var firstKernel = CentralDispatch.Container;
var secondKernel = CentralDispatch.Kernel; var secondKernel = CentralDispatch.Container;
firstKernel.Should().BeSameAs(secondKernel); firstKernel.Should().BeSameAs(secondKernel);
} }
@ -26,7 +26,7 @@ namespace NzbDrone.App.Test
[Test] [Test]
public void Kernel_should_be_able_to_resolve_ApplicationServer() public void Kernel_should_be_able_to_resolve_ApplicationServer()
{ {
var appServer = CentralDispatch.Kernel.Get<ApplicationServer>(); var appServer = CentralDispatch.Container.Resolve<ApplicationServer>();
appServer.Should().NotBeNull(); appServer.Should().NotBeNull();
} }
@ -34,8 +34,8 @@ namespace NzbDrone.App.Test
[Test] [Test]
public void Kernel_should_resolve_same_ApplicationServer_instance() public void Kernel_should_resolve_same_ApplicationServer_instance()
{ {
var appServer1 = CentralDispatch.Kernel.Get<ApplicationServer>(); var appServer1 = CentralDispatch.Container.Resolve<ApplicationServer>();
var appServer2 = CentralDispatch.Kernel.Get<ApplicationServer>(); var appServer2 = CentralDispatch.Container.Resolve<ApplicationServer>();
appServer1.Should().BeSameAs(appServer2); appServer1.Should().BeSameAs(appServer2);
} }

View File

@ -3,8 +3,7 @@
//using FluentAssertions; //using FluentAssertions;
//using Moq; //using Moq;
//using NUnit.Framework; //using NUnit.Framework;
//using Ninject; ////using NzbDrone.Common;
//using NzbDrone.Common;
//using NzbDrone.Common.Model; //using NzbDrone.Common.Model;
//using NzbDrone.Providers; //using NzbDrone.Providers;
//using NzbDrone.Test.Common; //using NzbDrone.Test.Common;

View File

@ -53,6 +53,12 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Autofac">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll</HintPath>
</Reference>
<Reference Include="Autofac.Configuration">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.Configuration.dll</HintPath>
</Reference>
<Reference Include="FizzWare.NBuilder, Version=3.0.1.0, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL"> <Reference Include="FizzWare.NBuilder, Version=3.0.1.0, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL">
<HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath> <HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath>
</Reference> </Reference>
@ -63,10 +69,6 @@
<Reference Include="Moq"> <Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath> <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ninject, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
</Reference> </Reference>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Autofac" version="2.6.3.862" targetFramework="net40" />
<package id="FluentAssertions" version="1.7.0" /> <package id="FluentAssertions" version="1.7.0" />
<package id="Moq" version="4.0.10827" /> <package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="3.0.1.1" /> <package id="NBuilder" version="3.0.1.1" />
<package id="Ninject" version="3.0.1.10" targetFramework="net40" />
<package id="NLog" version="2.0.0.2000" /> <package id="NLog" version="2.0.0.2000" />
<package id="NUnit" version="2.6.0.12054" /> <package id="NUnit" version="2.6.0.12054" />
</packages> </packages>

View File

@ -53,6 +53,12 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Autofac">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll</HintPath>
</Reference>
<Reference Include="Autofac.Configuration">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.Configuration.dll</HintPath>
</Reference>
<Reference Include="FluentAssertions, Version=1.7.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL"> <Reference Include="FluentAssertions, Version=1.7.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\FluentAssertions.1.7.0\Lib\net40\FluentAssertions.dll</HintPath> <HintPath>..\packages\FluentAssertions.1.7.0\Lib\net40\FluentAssertions.dll</HintPath>
@ -60,10 +66,6 @@
<Reference Include="Moq"> <Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath> <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ninject, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll</HintPath>
</Reference>
<Reference Include="NLog"> <Reference Include="NLog">
<HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
</Reference> </Reference>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Autofac" version="2.6.3.862" targetFramework="net40" />
<package id="FluentAssertions" version="1.7.0" /> <package id="FluentAssertions" version="1.7.0" />
<package id="Moq" version="4.0.10827" /> <package id="Moq" version="4.0.10827" />
<package id="Ninject" version="3.0.1.10" targetFramework="net40" />
<package id="NLog" version="2.0.0.2000" /> <package id="NLog" version="2.0.0.2000" />
<package id="NUnit" version="2.6.0.12054" /> <package id="NUnit" version="2.6.0.12054" />
</packages> </packages>

View File

@ -4,7 +4,6 @@ using System.Linq;
using System.Xml.Linq; using System.Xml.Linq;
using System.Xml.XPath; using System.Xml.XPath;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common.Model; using NzbDrone.Common.Model;
namespace NzbDrone.Common namespace NzbDrone.Common
@ -16,7 +15,6 @@ namespace NzbDrone.Common
private readonly string _configFile; private readonly string _configFile;
[Inject]
public ConfigFileProvider(EnvironmentProvider environmentProvider) public ConfigFileProvider(EnvironmentProvider environmentProvider)
{ {
_environmentProvider = environmentProvider; _environmentProvider = environmentProvider;

View File

@ -5,7 +5,6 @@ using System.IO;
using System.Net; using System.Net;
using System.Text; using System.Text;
using NLog; using NLog;
using Ninject;
namespace NzbDrone.Common namespace NzbDrone.Common
{ {
@ -14,7 +13,6 @@ namespace NzbDrone.Common
private readonly EnvironmentProvider _environmentProvider; private readonly EnvironmentProvider _environmentProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public HttpProvider(EnvironmentProvider environmentProvider) public HttpProvider(EnvironmentProvider environmentProvider)
{ {
_environmentProvider = environmentProvider; _environmentProvider = environmentProvider;

View File

@ -2,7 +2,6 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using NLog; using NLog;
using Ninject;
namespace NzbDrone.Common namespace NzbDrone.Common
{ {
@ -15,7 +14,6 @@ namespace NzbDrone.Common
private readonly EnvironmentProvider _environmentProvider; private readonly EnvironmentProvider _environmentProvider;
[Inject]
public IISProvider(ConfigFileProvider configFileProvider, ProcessProvider processProvider, EnvironmentProvider environmentProvider) public IISProvider(ConfigFileProvider configFileProvider, ProcessProvider processProvider, EnvironmentProvider environmentProvider)
{ {
_configFileProvider = configFileProvider; _configFileProvider = configFileProvider;

View File

@ -53,6 +53,12 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Autofac">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll</HintPath>
</Reference>
<Reference Include="Autofac.Configuration">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.Configuration.dll</HintPath>
</Reference>
<Reference Include="Exceptron.Client, Version=1.0.7.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Exceptron.Client, Version=1.0.7.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Exceptron.Client.1.0.7\lib\net20\Exceptron.Client.dll</HintPath> <HintPath>..\packages\Exceptron.Client.1.0.7\lib\net20\Exceptron.Client.dll</HintPath>
@ -61,10 +67,6 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ninject, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll</HintPath>
</Reference>
<Reference Include="NLog"> <Reference Include="NLog">
<HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
</Reference> </Reference>

View File

@ -5,7 +5,6 @@ using System.Net;
using System.Text; using System.Text;
using NLog; using NLog;
using Newtonsoft.Json; using Newtonsoft.Json;
using Ninject;
using NzbDrone.Common.Contract; using NzbDrone.Common.Contract;
namespace NzbDrone.Common namespace NzbDrone.Common
@ -19,7 +18,6 @@ namespace NzbDrone.Common
private readonly EnvironmentProvider _environmentProvider; private readonly EnvironmentProvider _environmentProvider;
[Inject]
public RestProvider(EnvironmentProvider environmentProvider) public RestProvider(EnvironmentProvider environmentProvider)
{ {
_environmentProvider = environmentProvider; _environmentProvider = environmentProvider;

View File

@ -4,7 +4,6 @@ using System.Linq;
using System.Security.Principal; using System.Security.Principal;
using NLog; using NLog;
using NetFwTypeLib; using NetFwTypeLib;
using Ninject;
namespace NzbDrone.Common namespace NzbDrone.Common
{ {
@ -16,7 +15,6 @@ namespace NzbDrone.Common
private readonly EnvironmentProvider _environmentProvider; private readonly EnvironmentProvider _environmentProvider;
private readonly ProcessProvider _processProvider; private readonly ProcessProvider _processProvider;
[Inject]
public SecurityProvider(ConfigFileProvider configFileProvider, EnvironmentProvider environmentProvider, public SecurityProvider(ConfigFileProvider configFileProvider, EnvironmentProvider environmentProvider,
ProcessProvider processProvider) ProcessProvider processProvider)
{ {

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Autofac" version="2.6.3.862" targetFramework="net40" />
<package id="Exceptron.Client" version="1.0.7" targetFramework="net40" /> <package id="Exceptron.Client" version="1.0.7" targetFramework="net40" />
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" /> <package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" />
<package id="Ninject" version="3.0.1.10" targetFramework="net40" />
<package id="NLog" version="2.0.0.2000" /> <package id="NLog" version="2.0.0.2000" />
</packages> </packages>

View File

@ -2,6 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Autofac;
using FluentAssertions; using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Common; using NzbDrone.Common;
@ -9,7 +10,6 @@ using NzbDrone.Core.Jobs;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Indexer; using NzbDrone.Core.Providers.Indexer;
using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Test.Framework;
using Ninject;
namespace NzbDrone.Core.Test namespace NzbDrone.Core.Test
{ {
@ -19,12 +19,14 @@ namespace NzbDrone.Core.Test
readonly IList<Type> indexers = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(IndexerBase))).ToList(); readonly IList<Type> indexers = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(IndexerBase))).ToList();
readonly IList<Type> jobs = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IJob))).ToList(); readonly IList<Type> jobs = typeof(CentralDispatch).Assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IJob))).ToList();
private IKernel kernel; private IContainer kernel;
public CentralDispatchFixture() public CentralDispatchFixture()
{ {
InitLogging(); InitLogging();
kernel = new CentralDispatch().Kernel; var dispatch = new CentralDispatch();
kernel = dispatch.Build();
WebTimer.Stop(); WebTimer.Stop();
} }
@ -44,7 +46,7 @@ namespace NzbDrone.Core.Test
foreach (var provider in providers) foreach (var provider in providers)
{ {
Console.WriteLine("Resolving " + provider.Name); Console.WriteLine("Resolving " + provider.Name);
kernel.Get(provider).Should().NotBeNull(); kernel.Resolve(provider).Should().NotBeNull();
} }
} }
@ -54,7 +56,7 @@ namespace NzbDrone.Core.Test
{ {
//Assert //Assert
var registeredJobs = kernel.GetAll<IJob>(); var registeredJobs = kernel.Resolve<IEnumerable<IJob>>();
jobs.Should().NotBeEmpty(); jobs.Should().NotBeEmpty();
@ -67,7 +69,7 @@ namespace NzbDrone.Core.Test
{ {
//Assert //Assert
var registeredIndexers = kernel.GetAll<IndexerBase>(); var registeredIndexers = kernel.Resolve<IEnumerable<IndexerBase>>();
indexers.Should().NotBeEmpty(); indexers.Should().NotBeEmpty();
@ -78,26 +80,26 @@ namespace NzbDrone.Core.Test
[Test] [Test]
public void jobs_are_initialized() public void jobs_are_initialized()
{ {
kernel.Get<JobProvider>().All().Should().HaveSameCount(jobs); kernel.Resolve<JobProvider>().All().Should().HaveSameCount(jobs);
} }
[Test] [Test]
public void indexers_are_initialized() public void indexers_are_initialized()
{ {
kernel.Get<IndexerProvider>().All().Should().HaveSameCount(indexers); kernel.Resolve<IndexerProvider>().All().Should().HaveSameCount(indexers);
} }
[Test] [Test]
public void quality_profile_initialized() public void quality_profile_initialized()
{ {
kernel.Get<QualityProvider>().All().Should().HaveCount(2); kernel.Resolve<QualityProvider>().All().Should().HaveCount(2);
} }
[Test] [Test]
public void JobProvider_should_be_singletone() public void JobProvider_should_be_singletone()
{ {
var first = kernel.Get<JobProvider>(); var first = kernel.Resolve<JobProvider>();
var second = kernel.Get<JobProvider>(); var second = kernel.Resolve<JobProvider>();
first.Should().BeSameAs(second); first.Should().BeSameAs(second);
} }

View File

@ -54,7 +54,6 @@ namespace NzbDrone.Core.Test.Framework
Mocker.SetConstant(Db); Mocker.SetConstant(Db);
} }
protected static ProgressNotification MockNotification protected static ProgressNotification MockNotification
{ {
get get

View File

@ -6,7 +6,6 @@ using System.Linq;
using System.Xml.Linq; using System.Xml.Linq;
using FluentAssertions; using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Helpers; using NzbDrone.Core.Helpers;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;

View File

@ -1,11 +1,12 @@
using System; using System;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using Autofac;
using FluentAssertions; using FluentAssertions;
using NLog; using NLog;
using NUnit.Framework; using NUnit.Framework;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -17,24 +18,27 @@ namespace NzbDrone.Core.Test.Integeration
[TestFixture(Category = "ServiceIngeneration")] [TestFixture(Category = "ServiceIngeneration")]
public class ServiceIntegerationFixture : CoreTest public class ServiceIntegerationFixture : CoreTest
{ {
private KernelBase _kernel; private IContainer _container;
[SetUp] [SetUp]
public void Setup() public void Setup()
{ {
WithRealDb(); WithRealDb();
_kernel = new StandardKernel(); var builder = new CentralDispatch().ContainerBuilder;
_kernel.Bind<IDatabase>().ToConstant(Db);
builder.Register(c => Db)
.As<IDatabase>();
_container = builder.Build();
Mocker.GetMock<ConfigProvider>().SetupGet(s => s.ServiceRootUrl) Mocker.GetMock<ConfigProvider>().SetupGet(s => s.ServiceRootUrl)
.Returns("http://services.nzbdrone.com"); .Returns("http://services.nzbdrone.com");
} }
[Test] [Test]
public void should_be_able_to_update_scene_mapping() public void should_be_able_to_update_scene_mapping()
{ {
_kernel.Get<SceneMappingProvider>().UpdateMappings(); _container.Resolve<SceneMappingProvider>().UpdateMappings();
var mappings = Db.Fetch<SceneMapping>(); var mappings = Db.Fetch<SceneMapping>();
mappings.Should().NotBeEmpty(); mappings.Should().NotBeEmpty();
@ -47,7 +51,7 @@ namespace NzbDrone.Core.Test.Integeration
[Test] [Test]
public void should_be_able_to_get_daily_series_ids() public void should_be_able_to_get_daily_series_ids()
{ {
var dailySeries = _kernel.Get<ReferenceDataProvider>().GetDailySeriesIds(); var dailySeries = _container.Resolve<ReferenceDataProvider>().GetDailySeriesIds();
dailySeries.Should().NotBeEmpty(); dailySeries.Should().NotBeEmpty();
dailySeries.Should().OnlyContain(c => c > 0); dailySeries.Should().OnlyContain(c => c > 0);
@ -76,11 +80,6 @@ namespace NzbDrone.Core.Test.Integeration
hash.Should().HaveLength(8); hash.Should().HaveLength(8);
} }
} }
} }
} }

View File

@ -56,6 +56,12 @@
<Reference Include="Accessibility"> <Reference Include="Accessibility">
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="Autofac">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll</HintPath>
</Reference>
<Reference Include="Autofac.Configuration">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.Configuration.dll</HintPath>
</Reference>
<Reference Include="AutoMoq"> <Reference Include="AutoMoq">
<HintPath>..\packages\AutoMoq.1.6.1\lib\AutoMoq.dll</HintPath> <HintPath>..\packages\AutoMoq.1.6.1\lib\AutoMoq.dll</HintPath>
</Reference> </Reference>
@ -97,10 +103,6 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ninject, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
</Reference> </Reference>

View File

@ -69,7 +69,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void running_scheduled_jobs_should_updates_last_execution_time() public void running_scheduled_jobs_should_updates_last_execution_time()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
//Act //Act
@ -86,7 +86,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void failing_scheduled_job_should_mark_job_as_failed() public void failing_scheduled_job_should_mark_job_as_failed()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { brokenJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { brokenJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
//Act //Act
@ -105,7 +105,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void scheduler_skips_jobs_that_arent_mature_yet() public void scheduler_skips_jobs_that_arent_mature_yet()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
//Act //Act
@ -126,7 +126,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
//after execution so the job can successfully run. //after execution so the job can successfully run.
public void can_run_async_job_again() public void can_run_async_job_again()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
var jobProvider = Mocker.Resolve<JobProvider>(); var jobProvider = Mocker.Resolve<JobProvider>();
@ -146,7 +146,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void no_concurent_jobs() public void no_concurent_jobs()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { slowJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { slowJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
var jobProvider = Mocker.Resolve<JobProvider>(); var jobProvider = Mocker.Resolve<JobProvider>();
@ -166,7 +166,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void can_run_broken_job_again() public void can_run_broken_job_again()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { brokenJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { brokenJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
@ -188,7 +188,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void schedule_hit_should_be_ignored_if_queue_is_running() public void schedule_hit_should_be_ignored_if_queue_is_running()
{ {
IList<IJob> fakeJobs = new List<IJob> { slowJob, fakeJob }; IEnumerable<IJob> fakeJobs = new List<IJob> { slowJob, fakeJob };
Mocker.SetConstant(fakeJobs); Mocker.SetConstant(fakeJobs);
@ -210,8 +210,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void can_queue_jobs_at_the_same_time() public void can_queue_jobs_at_the_same_time()
{ {
IEnumerable<IJob> BaseFakeJobs = new List<IJob> { slowJob, fakeJob };
IList<IJob> BaseFakeJobs = new List<IJob> { slowJob, fakeJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
var jobProvider = Mocker.Resolve<JobProvider>(); var jobProvider = Mocker.Resolve<JobProvider>();
@ -238,7 +237,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void Init_Jobs() public void Init_Jobs()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
@ -265,7 +264,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
var fakeTimer = new FakeJob(); var fakeTimer = new FakeJob();
IList<IJob> BaseFakeJobs = new List<IJob> { fakeTimer }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { fakeTimer };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
@ -287,7 +286,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void inti_should_removed_jobs_that_no_longer_exist() public void inti_should_removed_jobs_that_no_longer_exist()
{ {
IList<IJob> fakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> fakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(fakeJobs); Mocker.SetConstant(fakeJobs);
WithRealDb(); WithRealDb();
@ -307,7 +306,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void inti_should_removed_jobs_that_no_longer_exist_even_with_same_name() public void inti_should_removed_jobs_that_no_longer_exist_even_with_same_name()
{ {
IList<IJob> fakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> fakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(fakeJobs); Mocker.SetConstant(fakeJobs);
WithRealDb(); WithRealDb();
@ -329,7 +328,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void init_should_update_existing_job() public void init_should_update_existing_job()
{ {
IList<IJob> fakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> fakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(fakeJobs); Mocker.SetConstant(fakeJobs);
WithRealDb(); WithRealDb();
@ -364,7 +363,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void jobs_with_zero_interval_are_registered_as_disabled() public void jobs_with_zero_interval_are_registered_as_disabled()
{ {
IList<IJob> fakeJobs = new List<IJob> { disabledJob }; IEnumerable<IJob> fakeJobs = new List<IJob> { disabledJob };
Mocker.SetConstant(fakeJobs); Mocker.SetConstant(fakeJobs);
var jobProvider = Mocker.Resolve<JobProvider>(); var jobProvider = Mocker.Resolve<JobProvider>();
@ -378,7 +377,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void disabled_jobs_arent_run_by_scheduler() public void disabled_jobs_arent_run_by_scheduler()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { disabledJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { disabledJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
var jobProvider = Mocker.Resolve<JobProvider>(); var jobProvider = Mocker.Resolve<JobProvider>();
@ -394,7 +393,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void job_with_specific_target_should_not_update_last_execution() public void job_with_specific_target_should_not_update_last_execution()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
//Act //Act
@ -412,7 +411,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void job_with_specific_target_should_not_set_success_flag() public void job_with_specific_target_should_not_set_success_flag()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
//Act //Act
@ -430,7 +429,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void duplicated_queue_item_should_start_queue_if_its_not_running() public void duplicated_queue_item_should_start_queue_if_its_not_running()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { fakeJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { fakeJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
var stuckQueueItem = new JobQueueItem var stuckQueueItem = new JobQueueItem
@ -456,7 +455,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void Item_added_to_queue_while_scheduler_runs_should_be_executed() public void Item_added_to_queue_while_scheduler_runs_should_be_executed()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { slowJob, disabledJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { slowJob, disabledJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
ResetLastExecution(); ResetLastExecution();
@ -477,7 +476,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void trygin_to_queue_unregistered_job_should_fail() public void trygin_to_queue_unregistered_job_should_fail()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { slowJob, disabledJob }; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { slowJob, disabledJob };
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
var jobProvider = Mocker.Resolve<JobProvider>(); var jobProvider = Mocker.Resolve<JobProvider>();
@ -492,7 +491,7 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
[Test] [Test]
public void scheduled_job_should_have_scheduler_as_source() public void scheduled_job_should_have_scheduler_as_source()
{ {
IList<IJob> BaseFakeJobs = new List<IJob> { slowJob, fakeJob}; IEnumerable<IJob> BaseFakeJobs = new List<IJob> { slowJob, fakeJob};
Mocker.SetConstant(BaseFakeJobs); Mocker.SetConstant(BaseFakeJobs);
var jobProvider = Mocker.Resolve<JobProvider>(); var jobProvider = Mocker.Resolve<JobProvider>();
@ -504,8 +503,5 @@ namespace NzbDrone.Core.Test.ProviderTests.JobProviderTests
WaitForQueue(); WaitForQueue();
} }
} }
} }

View File

@ -3,9 +3,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Autofac;
using FluentAssertions; using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Test.Framework;
@ -24,7 +24,14 @@ namespace NzbDrone.Core.Test.ProviderTests
[SetUp] [SetUp]
public void Setup() public void Setup()
{ {
tvDbProvider = new StandardKernel().Get<TvDbProvider>(); var builder = new ContainerBuilder();
builder.RegisterType<EnvironmentProvider>();
builder.RegisterType<TvDbProvider>();
var container = builder.Build();
tvDbProvider = container.Resolve<TvDbProvider>();
} }
[TearDown] [TearDown]

View File

@ -7,7 +7,6 @@ using System.Linq;
using FluentAssertions; using FluentAssertions;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Test.Framework;

View File

@ -5,7 +5,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using FluentAssertions; using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Test.Framework;

View File

@ -7,7 +7,6 @@ using System.Linq;
using FluentAssertions; using FluentAssertions;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Test.Framework;

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Autofac" version="2.6.3.862" targetFramework="net40" />
<package id="AutoMoq" version="1.6.1" targetFramework="net40" /> <package id="AutoMoq" version="1.6.1" targetFramework="net40" />
<package id="CommonServiceLocator" version="1.0" targetFramework="net40" /> <package id="CommonServiceLocator" version="1.0" targetFramework="net40" />
<package id="EntityFramework" version="4.3.1" targetFramework="net40" /> <package id="EntityFramework" version="4.3.1" targetFramework="net40" />
@ -10,7 +11,6 @@
<package id="Moq" version="4.0.10827" /> <package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="3.0.1.1" /> <package id="NBuilder" version="3.0.1.1" />
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" /> <package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" />
<package id="Ninject" version="3.0.1.10" targetFramework="net40" />
<package id="NLog" version="2.0.0.2000" /> <package id="NLog" version="2.0.0.2000" />
<package id="NUnit" version="2.6.0.12054" /> <package id="NUnit" version="2.6.0.12054" />
<package id="Prowlin" version="0.9.4456.26422" targetFramework="net40" /> <package id="Prowlin" version="0.9.4456.26422" targetFramework="net40" />

View File

@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autofac;
using Autofac.Builder;
using Autofac.Core;
using SignalR;
namespace NzbDrone.Core
{
public class AutofacSignalrDependencyResolver : DefaultDependencyResolver, IDependencyResolver, IRegistrationSource
{
private ILifetimeScope LifetimeScope { get; set; }
public AutofacSignalrDependencyResolver(ILifetimeScope lifetimeScope)
{
LifetimeScope = lifetimeScope;
var currentRegistrationSource =
LifetimeScope.ComponentRegistry.Sources.FirstOrDefault(s => s.GetType() == GetType());
if (currentRegistrationSource != null)
{
((AutofacSignalrDependencyResolver)currentRegistrationSource).LifetimeScope = lifetimeScope;
}
else
{
LifetimeScope.ComponentRegistry.AddRegistrationSource(this);
}
}
public AutofacSignalrDependencyResolver()
{
}
public override object GetService(Type serviceType)
{
object result;
if (LifetimeScope == null)
{
return base.GetService(serviceType);
}
if (LifetimeScope.TryResolve(serviceType, out result))
{
return result;
}
return null;
}
public override IEnumerable<object> GetServices(Type serviceType)
{
object result;
if (LifetimeScope == null)
{
return base.GetServices(serviceType);
}
if (LifetimeScope.TryResolve(typeof(IEnumerable<>).MakeGenericType(serviceType), out result))
{
return (IEnumerable<object>)result;
}
return Enumerable.Empty<object>();
}
public IEnumerable<IComponentRegistration> RegistrationsFor(Service service, Func<Service, IEnumerable<IComponentRegistration>> registrationAccessor)
{
var typedService = service as TypedService;
if (typedService != null)
{
var instances = base.GetServices(typedService.ServiceType);
if (instances != null)
{
return instances
.Select(i => RegistrationBuilder.ForDelegate(i.GetType(), (c, p) => i).As(typedService.ServiceType)
.InstancePerLifetimeScope()
.PreserveExistingDefaults()
.CreateRegistration());
}
}
return Enumerable.Empty<IComponentRegistration>();
}
bool IRegistrationSource.IsAdapterForIndividualComponents
{
get { return false; }
}
}
}

View File

@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using Autofac;
using Autofac.Core;
using DeskMetrics; using DeskMetrics;
using Ninject;
using NLog; using NLog;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Instrumentation;
@ -29,140 +31,113 @@ namespace NzbDrone.Core
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
private readonly EnvironmentProvider _environmentProvider; private readonly EnvironmentProvider _environmentProvider;
public StandardKernel Kernel { get; private set; } public ContainerBuilder ContainerBuilder { get; private set; }
public CentralDispatch() public CentralDispatch()
{ {
_environmentProvider = new EnvironmentProvider(); _environmentProvider = new EnvironmentProvider();
logger.Debug("Initializing Kernel:"); logger.Debug("Initializing ContainerBuilder:");
Kernel = new StandardKernel(); ContainerBuilder = new ContainerBuilder();
GlobalHost.DependencyResolver = new NinjectDependencyResolver(Kernel); ContainerBuilder.RegisterAssemblyTypes(typeof(DiskProvider).Assembly).SingleInstance();
ContainerBuilder.RegisterAssemblyTypes(typeof(CentralDispatch).Assembly).SingleInstance();
ContainerBuilder.RegisterType<EnvironmentProvider>();
InitDatabase(); InitDatabase();
InitReporting();
InitQuality();
InitExternalNotifications(); InitExternalNotifications();
InitMetadataProviders(); InitMetadataProviders();
InitIndexers(); InitIndexers();
InitJobs(); RegisterJobs();
} }
private void InitDatabase() private void InitDatabase()
{ {
logger.Info("Initializing Database..."); logger.Info("Registering Database...");
var appDataPath = _environmentProvider.GetAppDataPath(); var appDataPath = _environmentProvider.GetAppDataPath();
if (!Directory.Exists(appDataPath)) Directory.CreateDirectory(appDataPath); if (!Directory.Exists(appDataPath)) Directory.CreateDirectory(appDataPath);
var connection = Kernel.Get<Connection>(); ContainerBuilder.Register(c => c.Resolve<Connection>().GetMainPetaPocoDb())
Kernel.Bind<IDatabase>().ToMethod(c => connection.GetMainPetaPocoDb()).InTransientScope(); .As<IDatabase>();
Kernel.Bind<IDatabase>().ToMethod(c => connection.GetLogPetaPocoDb(false)).WhenInjectedInto<DatabaseTarget>().InSingletonScope();
Kernel.Bind<IDatabase>().ToMethod(c => connection.GetLogPetaPocoDb()).WhenInjectedInto<LogProvider>();
Kernel.Bind<LogDbContext>().ToMethod(c => connection.GetLogEfContext()).WhenInjectedInto<LogProvider>().InSingletonScope();
Kernel.Get<DatabaseTarget>().Register(); ContainerBuilder.Register(c => c.Resolve<Connection>().GetLogPetaPocoDb(false))
LogConfiguration.Reload(); .SingleInstance()
} .Named<IDatabase>("DatabaseTarget");
private void InitReporting() ContainerBuilder.Register(c => c.Resolve<Connection>().GetLogPetaPocoDb())
{ .Named<IDatabase>("LogProvider");
EnvironmentProvider.UGuid = Kernel.Get<ConfigProvider>().UGuid;
ReportingService.RestProvider = Kernel.Get<RestProvider>();
ReportingService.SetupExceptronDriver();
}
private void InitQuality() ContainerBuilder.Register(c => c.Resolve<Connection>().GetLogEfContext())
{ .As<LogDbContext>()
logger.Debug("Initializing Quality..."); .SingleInstance();
Kernel.Get<QualityProvider>().SetupDefaultProfiles();
Kernel.Get<QualityTypeProvider>().SetupDefault(); ContainerBuilder.RegisterType<DatabaseTarget>().WithParameter(ResolvedParameter.ForNamed<IDatabase>("DatabaseTarget"));
ContainerBuilder.RegisterType<LogProvider>().WithParameter(ResolvedParameter.ForNamed<IDatabase>("LogProvider"));
} }
private void InitIndexers() private void InitIndexers()
{ {
logger.Debug("Initializing Indexers..."); logger.Debug("Registering Indexers...");
Kernel.Bind<IndexerBase>().To<NzbsRUs>();
Kernel.Bind<IndexerBase>().To<Newznab>();
Kernel.Bind<IndexerBase>().To<Wombles>();
Kernel.Bind<IndexerBase>().To<FileSharingTalk>();
Kernel.Bind<IndexerBase>().To<NzbIndex>();
Kernel.Bind<IndexerBase>().To<NzbClub>();
Kernel.Bind<IndexerBase>().To<Omgwtfnzbs>();
Kernel.Bind<IndexerBase>().To<Nzbx>();
var indexers = Kernel.GetAll<IndexerBase>(); ContainerBuilder.RegisterAssemblyTypes(typeof(CentralDispatch).Assembly)
Kernel.Get<IndexerProvider>().InitializeIndexers(indexers.ToList()); .Where(t => t.BaseType == typeof(IndexerBase))
.As<IndexerBase>();
var newznabIndexers = new List<NewznabDefinition> //ContainerBuilder.Bind<IndexerBase>().To<NzbsRUs>();
{ //ContainerBuilder.Bind<IndexerBase>().To<Newznab>();
new NewznabDefinition { Enable = false, Name = "Nzbs.org", Url = "http://nzbs.org", BuiltIn = true }, //ContainerBuilder.Bind<IndexerBase>().To<Wombles>();
new NewznabDefinition { Enable = false, Name = "Nzb.su", Url = "https://nzb.su", BuiltIn = true }, //ContainerBuilder.Bind<IndexerBase>().To<FileSharingTalk>();
new NewznabDefinition { Enable = false, Name = "Dognzb.cr", Url = "https://dognzb.cr", BuiltIn = true } //ContainerBuilder.Bind<IndexerBase>().To<NzbIndex>();
}; //ContainerBuilder.Bind<IndexerBase>().To<NzbClub>();
//ContainerBuilder.Bind<IndexerBase>().To<Omgwtfnzbs>();
Kernel.Get<NewznabProvider>().InitializeNewznabIndexers(newznabIndexers); //ContainerBuilder.Bind<IndexerBase>().To<Nzbx>();
} }
private void InitJobs() private void RegisterJobs()
{ {
logger.Debug("Initializing Background Jobs..."); logger.Debug("Registering Background Jobs...");
Kernel.Bind<JobProvider>().ToSelf().InSingletonScope(); ContainerBuilder.RegisterType<JobProvider>().SingleInstance();
Kernel.Bind<IJob>().To<RssSyncJob>().InSingletonScope(); ContainerBuilder.RegisterType<Xbmc>().As<ExternalNotificationBase>().SingleInstance();
Kernel.Bind<IJob>().To<ImportNewSeriesJob>().InSingletonScope();
Kernel.Bind<IJob>().To<UpdateInfoJob>().InSingletonScope();
Kernel.Bind<IJob>().To<DiskScanJob>().InSingletonScope();
Kernel.Bind<IJob>().To<DeleteSeriesJob>().InSingletonScope();
Kernel.Bind<IJob>().To<EpisodeSearchJob>().InSingletonScope();
Kernel.Bind<IJob>().To<PostDownloadScanJob>().InSingletonScope();
Kernel.Bind<IJob>().To<UpdateSceneMappingsJob>().InSingletonScope();
Kernel.Bind<IJob>().To<SeasonSearchJob>().InSingletonScope();
Kernel.Bind<IJob>().To<RenameSeasonJob>().InSingletonScope();
Kernel.Bind<IJob>().To<SeriesSearchJob>().InSingletonScope();
Kernel.Bind<IJob>().To<RenameSeriesJob>().InSingletonScope();
Kernel.Bind<IJob>().To<BacklogSearchJob>().InSingletonScope();
Kernel.Bind<IJob>().To<BannerDownloadJob>().InSingletonScope();
Kernel.Bind<IJob>().To<ConvertEpisodeJob>().InSingletonScope();
Kernel.Bind<IJob>().To<AppUpdateJob>().InSingletonScope();
Kernel.Bind<IJob>().To<TrimLogsJob>().InSingletonScope();
Kernel.Bind<IJob>().To<RecentBacklogSearchJob>().InSingletonScope();
Kernel.Bind<IJob>().To<SearchHistoryCleanupJob>().InSingletonScope();
Kernel.Bind<IJob>().To<PastWeekBacklogSearchJob>().InSingletonScope();
Kernel.Bind<IJob>().To<RefreshEpisodeMetadata>().InSingletonScope();
Kernel.Bind<IJob>().To<CleanupRecycleBinJob>().InSingletonScope();
Kernel.Bind<IJob>().To<EmptyRecycleBinJob>().InSingletonScope();
Kernel.Bind<IJob>().To<XemUpdateJob>().InSingletonScope();
Kernel.Get<JobProvider>().Initialize(); ContainerBuilder.RegisterAssemblyTypes(typeof(CentralDispatch).Assembly)
Kernel.Get<WebTimer>().StartTimer(30); .Where(t => t.GetInterfaces().Contains(typeof(IJob)))
.As<IJob>()
.SingleInstance();
} }
private void InitExternalNotifications() private void InitExternalNotifications()
{ {
logger.Debug("Initializing External Notifications..."); logger.Debug("Registering External Notifications...");
Kernel.Bind<ExternalNotificationBase>().To<Xbmc>(); ContainerBuilder.RegisterType<Xbmc>().As<ExternalNotificationBase>().SingleInstance();
Kernel.Bind<ExternalNotificationBase>().To<Smtp>(); ContainerBuilder.RegisterType<Smtp>().As<ExternalNotificationBase>().SingleInstance();
Kernel.Bind<ExternalNotificationBase>().To<Twitter>(); ContainerBuilder.RegisterType<Twitter>().As<ExternalNotificationBase>().SingleInstance();
Kernel.Bind<ExternalNotificationBase>().To<Providers.ExternalNotification.Growl>(); ContainerBuilder.RegisterType<Providers.ExternalNotification.Growl>().As<ExternalNotificationBase>().SingleInstance();
Kernel.Bind<ExternalNotificationBase>().To<Prowl>(); ContainerBuilder.RegisterType<Prowl>().As<ExternalNotificationBase>().SingleInstance();
Kernel.Bind<ExternalNotificationBase>().To<Plex>(); ContainerBuilder.RegisterType<Plex>().As<ExternalNotificationBase>().SingleInstance();
var notifiers = Kernel.GetAll<ExternalNotificationBase>();
Kernel.Get<ExternalNotificationProvider>().InitializeNotifiers(notifiers.ToList());
} }
private void InitMetadataProviders() private void InitMetadataProviders()
{ {
logger.Debug("Initializing Metadata Providers..."); logger.Debug("Registering Metadata Providers...");
Kernel.Bind<MetadataBase>().To<Providers.Metadata.Xbmc>().InSingletonScope(); ContainerBuilder.RegisterType<Providers.Metadata.Xbmc>().As<MetadataBase>().SingleInstance();
}
var providers = Kernel.GetAll<MetadataBase>(); private void InitReporting(IContainer container)
Kernel.Get<MetadataProvider>().Initialize(providers.ToList()); {
EnvironmentProvider.UGuid = container.Resolve<ConfigProvider>().UGuid;
ReportingService.RestProvider = container.Resolve<RestProvider>();
ReportingService.SetupExceptronDriver();
}
private void InitQuality(IContainer container)
{
logger.Debug("Initializing Quality...");
container.Resolve<QualityProvider>().SetupDefaultProfiles();
container.Resolve<QualityTypeProvider>().SetupDefault();
} }
public void DedicateToHost() public void DedicateToHost()
@ -190,6 +165,45 @@ namespace NzbDrone.Core
} }
} }
public IContainer Build()
{
var container = ContainerBuilder.Build();
logger.Debug("Initializing Components");
container.Resolve<DatabaseTarget>().Register();
LogConfiguration.Reload();
InitReporting(container);
InitQuality(container);
var indexers = container.Resolve<IEnumerable<IndexerBase>>();
container.Resolve<IndexerProvider>().InitializeIndexers(indexers.ToList());
var newznabIndexers = new List<NewznabDefinition>
{
new NewznabDefinition { Enable = false, Name = "Nzbs.org", Url = "http://nzbs.org", BuiltIn = true },
new NewznabDefinition { Enable = false, Name = "Nzb.su", Url = "https://nzb.su", BuiltIn = true },
new NewznabDefinition { Enable = false, Name = "Dognzb.cr", Url = "https://dognzb.cr", BuiltIn = true }
};
container.Resolve<NewznabProvider>().InitializeNewznabIndexers(newznabIndexers);
container.Resolve<JobProvider>().Initialize();
container.Resolve<WebTimer>().StartTimer(30);
var notifiers = container.Resolve<IEnumerable<ExternalNotificationBase>>();
container.Resolve<ExternalNotificationProvider>().InitializeNotifiers(notifiers.ToList());
var providers = container.Resolve<IEnumerable<MetadataBase>>();
container.Resolve<MetadataProvider>().Initialize(providers.ToList());
//SignalR
GlobalHost.DependencyResolver = new AutofacSignalrDependencyResolver(container.BeginLifetimeScope("SignalR"));
return container;
}
private static void ShutDown() private static void ShutDown()
{ {
logger.Info("Shutting down application..."); logger.Info("Shutting down application...");

View File

@ -1,6 +1,5 @@
using System; using System;
using NLog.Config; using NLog.Config;
using Ninject;
using NLog; using NLog;
using NLog.Targets; using NLog.Targets;
using NLog.Targets.Wrappers; using NLog.Targets.Wrappers;
@ -14,7 +13,6 @@ namespace NzbDrone.Core.Instrumentation
{ {
private readonly IDatabase _database; private readonly IDatabase _database;
[Inject]
public DatabaseTarget(IDatabase database) public DatabaseTarget(IDatabase database)
{ {
_database = database; _database = database;

View File

@ -1,13 +1,11 @@
using System.Data.Common; using System.Data.Common;
using System.Data.Entity; using System.Data.Entity;
using System.Linq; using System.Linq;
using Ninject;
namespace NzbDrone.Core.Instrumentation namespace NzbDrone.Core.Instrumentation
{ {
public class LogDbContext : DbContext public class LogDbContext : DbContext
{ {
[Inject]
public LogDbContext(DbConnection connection) public LogDbContext(DbConnection connection)
: base(connection, false) : base(connection, false)
{ {

View File

@ -3,7 +3,6 @@ using System.Linq;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -23,7 +22,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public AppUpdateJob(UpdateProvider updateProvider, EnvironmentProvider environmentProvider, DiskProvider diskProvider, public AppUpdateJob(UpdateProvider updateProvider, EnvironmentProvider environmentProvider, DiskProvider diskProvider,
HttpProvider httpProvider, ProcessProvider processProvider, ArchiveProvider archiveProvider, ConfigFileProvider configFileProvider) HttpProvider httpProvider, ProcessProvider processProvider, ArchiveProvider archiveProvider, ConfigFileProvider configFileProvider)
{ {

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -20,7 +19,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public BacklogSearchJob(EpisodeProvider episodeProvider, EpisodeSearchJob episodeSearchJob, public BacklogSearchJob(EpisodeProvider episodeProvider, EpisodeSearchJob episodeSearchJob,
SeasonSearchJob seasonSearchJob, ConfigProvider configProvider) SeasonSearchJob seasonSearchJob, ConfigProvider configProvider)
{ {

View File

@ -1,7 +1,6 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -19,7 +18,6 @@ namespace NzbDrone.Core.Jobs
private const string BANNER_URL_PREFIX = "http://www.thetvdb.com/banners/"; private const string BANNER_URL_PREFIX = "http://www.thetvdb.com/banners/";
[Inject]
public BannerDownloadJob(SeriesProvider seriesProvider, BannerProvider bannerProvider) public BannerDownloadJob(SeriesProvider seriesProvider, BannerProvider bannerProvider)
{ {
_seriesProvider = seriesProvider; _seriesProvider = seriesProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using System; using System;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -12,7 +11,6 @@ namespace NzbDrone.Core.Jobs
{ {
private readonly RecycleBinProvider _recycleBinProvider; private readonly RecycleBinProvider _recycleBinProvider;
[Inject]
public CleanupRecycleBinJob(RecycleBinProvider recycleBinProvider) public CleanupRecycleBinJob(RecycleBinProvider recycleBinProvider)
{ {
_recycleBinProvider = recycleBinProvider; _recycleBinProvider = recycleBinProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using System; using System;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -17,7 +16,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public ConvertEpisodeJob(HandbrakeProvider handbrakeProvider, AtomicParsleyProvider atomicParsleyProvider, public ConvertEpisodeJob(HandbrakeProvider handbrakeProvider, AtomicParsleyProvider atomicParsleyProvider,
EpisodeProvider episodeProvider) EpisodeProvider episodeProvider)
{ {

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using System; using System;
using Ninject;
using NLog; using NLog;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -15,7 +14,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public DeleteSeriesJob(SeriesProvider seriesProvider, RecycleBinProvider recycleBinProvider) public DeleteSeriesJob(SeriesProvider seriesProvider, RecycleBinProvider recycleBinProvider)
{ {
_seriesProvider = seriesProvider; _seriesProvider = seriesProvider;

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Helpers; using NzbDrone.Core.Helpers;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -18,7 +17,6 @@ namespace NzbDrone.Core.Jobs
private readonly ConfigProvider _configProvider; private readonly ConfigProvider _configProvider;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public DiskScanJob(SeriesProvider seriesProvider, DiskScanProvider diskScanProvider, public DiskScanJob(SeriesProvider seriesProvider, DiskScanProvider diskScanProvider,
ConfigProvider configProvider) ConfigProvider configProvider)
{ {

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using System; using System;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -12,7 +11,6 @@ namespace NzbDrone.Core.Jobs
{ {
private readonly RecycleBinProvider _recycleBinProvider; private readonly RecycleBinProvider _recycleBinProvider;
[Inject]
public EmptyRecycleBinJob(RecycleBinProvider recycleBinProvider) public EmptyRecycleBinJob(RecycleBinProvider recycleBinProvider)
{ {
_recycleBinProvider = recycleBinProvider; _recycleBinProvider = recycleBinProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using System; using System;
using Ninject;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -10,7 +9,6 @@ namespace NzbDrone.Core.Jobs
{ {
private readonly SearchProvider _searchProvider; private readonly SearchProvider _searchProvider;
[Inject]
public EpisodeSearchJob(SearchProvider searchProvider) public EpisodeSearchJob(SearchProvider searchProvider)
{ {
_searchProvider = searchProvider; _searchProvider = searchProvider;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -28,7 +27,6 @@ namespace NzbDrone.Core.Jobs
private List<int> _attemptedSeries; private List<int> _attemptedSeries;
[Inject]
public ImportNewSeriesJob(SeriesProvider seriesProvider, EpisodeProvider episodeProvider, public ImportNewSeriesJob(SeriesProvider seriesProvider, EpisodeProvider episodeProvider,
MediaFileProvider mediaFileProvider, UpdateInfoJob updateInfoJob, MediaFileProvider mediaFileProvider, UpdateInfoJob updateInfoJob,
DiskScanJob diskScanJob, BannerDownloadJob bannerDownloadJob, DiskScanJob diskScanJob, BannerDownloadJob bannerDownloadJob,

View File

@ -7,7 +7,6 @@ using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -25,7 +24,7 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
private readonly IDatabase _database; private readonly IDatabase _database;
private readonly NotificationProvider _notificationProvider; private readonly NotificationProvider _notificationProvider;
private readonly IList<IJob> _jobs; private readonly IEnumerable<IJob> _jobs;
private Thread _jobThread; private Thread _jobThread;
public Stopwatch StopWatch { get; private set; } public Stopwatch StopWatch { get; private set; }
@ -36,8 +35,7 @@ namespace NzbDrone.Core.Jobs
private ProgressNotification _notification; private ProgressNotification _notification;
[Inject] public JobProvider(IDatabase database, NotificationProvider notificationProvider, IEnumerable<IJob> jobs)
public JobProvider(IDatabase database, NotificationProvider notificationProvider, IList<IJob> jobs)
{ {
StopWatch = new Stopwatch(); StopWatch = new Stopwatch();
_database = database; _database = database;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -19,7 +18,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public PastWeekBacklogSearchJob(EpisodeProvider episodeProvider, EpisodeSearchJob episodeSearchJob, public PastWeekBacklogSearchJob(EpisodeProvider episodeProvider, EpisodeSearchJob episodeSearchJob,
ConfigProvider configProvider) ConfigProvider configProvider)
{ {

View File

@ -1,7 +1,6 @@
using System.Linq; using System.Linq;
using System; using System;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -17,7 +16,6 @@ namespace NzbDrone.Core.Jobs
private readonly ConfigProvider _configProvider; private readonly ConfigProvider _configProvider;
private readonly DiskProvider _diskProvider; private readonly DiskProvider _diskProvider;
[Inject]
public PostDownloadScanJob(PostDownloadProvider postDownloadProvider,ConfigProvider configProvider, DiskProvider diskProvider) public PostDownloadScanJob(PostDownloadProvider postDownloadProvider,ConfigProvider configProvider, DiskProvider diskProvider)
{ {
_postDownloadProvider = postDownloadProvider; _postDownloadProvider = postDownloadProvider;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -19,7 +18,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public RecentBacklogSearchJob(EpisodeProvider episodeProvider, EpisodeSearchJob episodeSearchJob, public RecentBacklogSearchJob(EpisodeProvider episodeProvider, EpisodeSearchJob episodeSearchJob,
ConfigProvider configProvider) ConfigProvider configProvider)
{ {

View File

@ -2,7 +2,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System; using System;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -17,7 +16,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public RefreshEpisodeMetadata(MediaFileProvider mediaFileProvider, SeriesProvider seriesProvider, public RefreshEpisodeMetadata(MediaFileProvider mediaFileProvider, SeriesProvider seriesProvider,
MetadataProvider metadataProvider) MetadataProvider metadataProvider)
{ {

View File

@ -2,7 +2,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System; using System;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -19,7 +18,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public RenameSeasonJob(MediaFileProvider mediaFileProvider, DiskScanProvider diskScanProvider, public RenameSeasonJob(MediaFileProvider mediaFileProvider, DiskScanProvider diskScanProvider,
ExternalNotificationProvider externalNotificationProvider, SeriesProvider seriesProvider, ExternalNotificationProvider externalNotificationProvider, SeriesProvider seriesProvider,
MetadataProvider metadataProvider) MetadataProvider metadataProvider)

View File

@ -2,7 +2,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System; using System;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -19,7 +18,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public RenameSeriesJob(MediaFileProvider mediaFileProvider, DiskScanProvider diskScanProvider, public RenameSeriesJob(MediaFileProvider mediaFileProvider, DiskScanProvider diskScanProvider,
ExternalNotificationProvider externalNotificationProvider, SeriesProvider seriesProvider, ExternalNotificationProvider externalNotificationProvider, SeriesProvider seriesProvider,
MetadataProvider metadataProvider) MetadataProvider metadataProvider)

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -26,7 +25,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public RssSyncJob(DownloadProvider downloadProvider, IndexerProvider indexerProvider, public RssSyncJob(DownloadProvider downloadProvider, IndexerProvider indexerProvider,
MonitoredEpisodeSpecification isMonitoredEpisodeSpecification, AllowedDownloadSpecification allowedDownloadSpecification, MonitoredEpisodeSpecification isMonitoredEpisodeSpecification, AllowedDownloadSpecification allowedDownloadSpecification,
UpgradeHistorySpecification upgradeHistorySpecification, ConfigProvider configProvider) UpgradeHistorySpecification upgradeHistorySpecification, ConfigProvider configProvider)

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Helpers; using NzbDrone.Core.Helpers;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -16,7 +15,6 @@ namespace NzbDrone.Core.Jobs
private readonly SearchHistoryProvider _searchHistoryProvider; private readonly SearchHistoryProvider _searchHistoryProvider;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public SearchHistoryCleanupJob(SearchHistoryProvider searchHistoryProvider) public SearchHistoryCleanupJob(SearchHistoryProvider searchHistoryProvider)
{ {
_searchHistoryProvider = searchHistoryProvider; _searchHistoryProvider = searchHistoryProvider;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -17,7 +16,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public SeasonSearchJob(SearchProvider searchProvider, EpisodeSearchJob episodeSearchJob, public SeasonSearchJob(SearchProvider searchProvider, EpisodeSearchJob episodeSearchJob,
EpisodeProvider episodeProvider) EpisodeProvider episodeProvider)
{ {

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -16,7 +15,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public SeriesSearchJob(SeasonSearchJob seasonSearchJob, public SeriesSearchJob(SeasonSearchJob seasonSearchJob,
SeasonProvider seasonProvider) SeasonProvider seasonProvider)
{ {

View File

@ -1,6 +1,5 @@
using System; using System;
using System.Linq; using System.Linq;
using Ninject;
using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Instrumentation;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
@ -10,7 +9,6 @@ namespace NzbDrone.Core.Jobs
{ {
private readonly LogProvider _logProvider; private readonly LogProvider _logProvider;
[Inject]
public TrimLogsJob(LogProvider logProvider) public TrimLogsJob(LogProvider logProvider)
{ {
_logProvider = logProvider; _logProvider = logProvider;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Helpers; using NzbDrone.Core.Helpers;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -19,7 +18,6 @@ namespace NzbDrone.Core.Jobs
private readonly ConfigProvider _configProvider; private readonly ConfigProvider _configProvider;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public UpdateInfoJob(SeriesProvider seriesProvider, EpisodeProvider episodeProvider, public UpdateInfoJob(SeriesProvider seriesProvider, EpisodeProvider episodeProvider,
ReferenceDataProvider referenceDataProvider, ConfigProvider configProvider) ReferenceDataProvider referenceDataProvider, ConfigProvider configProvider)
{ {

View File

@ -1,6 +1,5 @@
using System; using System;
using System.Linq; using System.Linq;
using Ninject;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -10,7 +9,6 @@ namespace NzbDrone.Core.Jobs
{ {
private readonly SceneMappingProvider _sceneNameMappingProvider; private readonly SceneMappingProvider _sceneNameMappingProvider;
[Inject]
public UpdateSceneMappingsJob(SceneMappingProvider sceneNameMappingProvider) public UpdateSceneMappingsJob(SceneMappingProvider sceneNameMappingProvider)
{ {
_sceneNameMappingProvider = sceneNameMappingProvider; _sceneNameMappingProvider = sceneNameMappingProvider;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Helpers; using NzbDrone.Core.Helpers;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
@ -16,7 +15,6 @@ namespace NzbDrone.Core.Jobs
private static readonly Logger _logger = LogManager.GetCurrentClassLogger(); private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
[Inject]
public XemUpdateJob(XemProvider xemProvider) public XemUpdateJob(XemProvider xemProvider)
{ {
_xemProvider = xemProvider; _xemProvider = xemProvider;

View File

@ -1,34 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ninject;
using SignalR;
namespace NzbDrone.Core
{
public class NinjectDependencyResolver : DefaultDependencyResolver
{
private readonly IKernel _kernel;
public NinjectDependencyResolver(IKernel kernel)
{
if (kernel == null)
{
throw new ArgumentNullException("kernel");
}
_kernel = kernel;
}
public override object GetService(Type serviceType)
{
return _kernel.TryGet(serviceType) ?? base.GetService(serviceType);
}
public override IEnumerable<object> GetServices(Type serviceType)
{
return _kernel.GetAll(serviceType).Concat(base.GetServices(serviceType));
}
}
}

View File

@ -123,6 +123,12 @@
<StartupObject /> <StartupObject />
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Autofac">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll</HintPath>
</Reference>
<Reference Include="Autofac.Configuration">
<HintPath>..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.Configuration.dll</HintPath>
</Reference>
<Reference Include="DataTables.Mvc.Core, Version=0.1.0.85, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="DataTables.Mvc.Core, Version=0.1.0.85, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\DataTables.Mvc.Core.0.1.0.85\lib\DataTables.Mvc.Core.dll</HintPath> <HintPath>..\packages\DataTables.Mvc.Core.0.1.0.85\lib\DataTables.Mvc.Core.dll</HintPath>
@ -167,10 +173,6 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ninject, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll</HintPath>
</Reference> </Reference>
@ -316,7 +318,7 @@
<Compile Include="Model\Xem\XemResult.cs" /> <Compile Include="Model\Xem\XemResult.cs" />
<Compile Include="Model\Xem\XemSceneTvdbMapping.cs" /> <Compile Include="Model\Xem\XemSceneTvdbMapping.cs" />
<Compile Include="Model\Xem\XemValues.cs" /> <Compile Include="Model\Xem\XemValues.cs" />
<Compile Include="NinjectDependencyResolver.cs" /> <Compile Include="AutofacSignalrDependencyResolver.cs" />
<Compile Include="Providers\BannerProvider.cs" /> <Compile Include="Providers\BannerProvider.cs" />
<Compile Include="Providers\DecisionEngine\AllowedReleaseGroupSpecification.cs" /> <Compile Include="Providers\DecisionEngine\AllowedReleaseGroupSpecification.cs" />
<Compile Include="Providers\DecisionEngine\CustomStartDateSpecification.cs" /> <Compile Include="Providers\DecisionEngine\CustomStartDateSpecification.cs" />

View File

@ -2,7 +2,6 @@
using System.Linq; using System.Linq;
using Ionic.Zip; using Ionic.Zip;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
namespace NzbDrone.Core.Providers namespace NzbDrone.Core.Providers
@ -12,7 +11,6 @@ namespace NzbDrone.Core.Providers
private readonly EnvironmentProvider _environmentProvider; private readonly EnvironmentProvider _environmentProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public BackupProvider(EnvironmentProvider environmentProvider) public BackupProvider(EnvironmentProvider environmentProvider)
{ {
_environmentProvider = environmentProvider; _environmentProvider = environmentProvider;

View File

@ -4,7 +4,6 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -20,7 +19,6 @@ namespace NzbDrone.Core.Providers
private const string BANNER_URL_PREFIX = "http://www.thetvdb.com/banners/"; private const string BANNER_URL_PREFIX = "http://www.thetvdb.com/banners/";
[Inject]
public BannerProvider(HttpProvider httpProvider, EnvironmentProvider environmentProvider, public BannerProvider(HttpProvider httpProvider, EnvironmentProvider environmentProvider,
DiskProvider diskProvider) DiskProvider diskProvider)
{ {

View File

@ -3,7 +3,6 @@ using System.IO;
using System.Linq; using System.Linq;
using Ionic.Zip; using Ionic.Zip;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
namespace NzbDrone.Core.Providers.Core namespace NzbDrone.Core.Providers.Core

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Sabnzbd; using NzbDrone.Core.Model.Sabnzbd;
@ -18,7 +17,6 @@ namespace NzbDrone.Core.Providers.Core
private readonly IDatabase _database; private readonly IDatabase _database;
[Inject]
public ConfigProvider(IDatabase database) public ConfigProvider(IDatabase database)
{ {
_database = database; _database = database;

View File

@ -4,7 +4,6 @@ using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
using NLog; using NLog;
using Ninject;
namespace NzbDrone.Core.Providers.Core namespace NzbDrone.Core.Providers.Core
{ {
@ -12,7 +11,6 @@ namespace NzbDrone.Core.Providers.Core
{ {
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
[Inject]
public UdpProvider() public UdpProvider()
{ {

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly EpisodeProvider _episodeProvider; private readonly EpisodeProvider _episodeProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public AcceptableSizeSpecification(QualityTypeProvider qualityTypeProvider, EpisodeProvider episodeProvider) public AcceptableSizeSpecification(QualityTypeProvider qualityTypeProvider, EpisodeProvider episodeProvider)
{ {
_qualityTypeProvider = qualityTypeProvider; _qualityTypeProvider = qualityTypeProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Repository.Search; using NzbDrone.Core.Repository.Search;
@ -17,7 +16,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly CustomStartDateSpecification _customStartDateSpecification; private readonly CustomStartDateSpecification _customStartDateSpecification;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public AllowedDownloadSpecification(QualityAllowedByProfileSpecification qualityAllowedByProfileSpecification, public AllowedDownloadSpecification(QualityAllowedByProfileSpecification qualityAllowedByProfileSpecification,
UpgradeDiskSpecification upgradeDiskSpecification, AcceptableSizeSpecification acceptableSizeSpecification, UpgradeDiskSpecification upgradeDiskSpecification, AcceptableSizeSpecification acceptableSizeSpecification,
AlreadyInQueueSpecification alreadyInQueueSpecification, RetentionSpecification retentionSpecification, AlreadyInQueueSpecification alreadyInQueueSpecification, RetentionSpecification retentionSpecification,

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -12,7 +11,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly ConfigProvider _configProvider; private readonly ConfigProvider _configProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public AllowedReleaseGroupSpecification(ConfigProvider configProvider) public AllowedReleaseGroupSpecification(ConfigProvider configProvider)
{ {
_configProvider = configProvider; _configProvider = configProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public AlreadyInQueueSpecification(DownloadProvider downloadProvider) public AlreadyInQueueSpecification(DownloadProvider downloadProvider)
{ {
_downloadProvider = downloadProvider; _downloadProvider = downloadProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly EpisodeProvider _episodeProvider; private readonly EpisodeProvider _episodeProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public MonitoredEpisodeSpecification(SeriesProvider seriesProvider, EpisodeProvider episodeProvider) public MonitoredEpisodeSpecification(SeriesProvider seriesProvider, EpisodeProvider episodeProvider)
{ {
_seriesProvider = seriesProvider; _seriesProvider = seriesProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly ConfigProvider _configProvider; private readonly ConfigProvider _configProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public RetentionSpecification(ConfigProvider configProvider) public RetentionSpecification(ConfigProvider configProvider)
{ {
_configProvider = configProvider; _configProvider = configProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly QualityUpgradeSpecification _qualityUpgradeSpecification; private readonly QualityUpgradeSpecification _qualityUpgradeSpecification;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public UpgradeDiskSpecification(EpisodeProvider episodeProvider, QualityUpgradeSpecification qualityUpgradeSpecification) public UpgradeDiskSpecification(EpisodeProvider episodeProvider, QualityUpgradeSpecification qualityUpgradeSpecification)
{ {
_episodeProvider = episodeProvider; _episodeProvider = episodeProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine
@ -12,7 +11,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly QualityUpgradeSpecification _qualityUpgradeSpecification; private readonly QualityUpgradeSpecification _qualityUpgradeSpecification;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public UpgradeHistorySpecification(EpisodeProvider episodeProvider, HistoryProvider historyProvider, QualityUpgradeSpecification qualityUpgradeSpecification) public UpgradeHistorySpecification(EpisodeProvider episodeProvider, HistoryProvider historyProvider, QualityUpgradeSpecification qualityUpgradeSpecification)
{ {
_episodeProvider = episodeProvider; _episodeProvider = episodeProvider;

View File

@ -1,6 +1,5 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine
@ -10,7 +9,6 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly QualityProvider _qualityProvider; private readonly QualityProvider _qualityProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public UpgradePossibleSpecification(QualityProvider qualityProvider) public UpgradePossibleSpecification(QualityProvider qualityProvider)
{ {
_qualityProvider = qualityProvider; _qualityProvider = qualityProvider;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
@ -25,7 +24,6 @@ namespace NzbDrone.Core.Providers
private readonly ConfigProvider _configProvider; private readonly ConfigProvider _configProvider;
private readonly RecycleBinProvider _recycleBinProvider; private readonly RecycleBinProvider _recycleBinProvider;
[Inject]
public DiskScanProvider(DiskProvider diskProvider, EpisodeProvider episodeProvider, public DiskScanProvider(DiskProvider diskProvider, EpisodeProvider episodeProvider,
SeriesProvider seriesProvider, MediaFileProvider mediaFileProvider, SeriesProvider seriesProvider, MediaFileProvider mediaFileProvider,
ExternalNotificationProvider externalNotificationProvider, DownloadProvider downloadProvider, ExternalNotificationProvider externalNotificationProvider, DownloadProvider downloadProvider,

View File

@ -2,7 +2,6 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -20,7 +19,6 @@ namespace NzbDrone.Core.Providers.DownloadClients
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public BlackholeProvider(ConfigProvider configProvider, HttpProvider httpProvider, public BlackholeProvider(ConfigProvider configProvider, HttpProvider httpProvider,
DiskProvider diskProvider, UpgradeHistorySpecification upgradeHistorySpecification) DiskProvider diskProvider, UpgradeHistorySpecification upgradeHistorySpecification)
{ {

View File

@ -2,7 +2,6 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -19,7 +18,6 @@ namespace NzbDrone.Core.Providers.DownloadClients
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public PneumaticProvider(ConfigProvider configProvider, HttpProvider httpProvider, public PneumaticProvider(ConfigProvider configProvider, HttpProvider httpProvider,
DiskProvider diskProvider, UpgradeHistorySpecification upgradeHistorySpecification) DiskProvider diskProvider, UpgradeHistorySpecification upgradeHistorySpecification)
{ {

View File

@ -6,7 +6,6 @@ using System.Text.RegularExpressions;
using System.Web; using System.Web;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
@ -21,7 +20,6 @@ namespace NzbDrone.Core.Providers.DownloadClients
private readonly ConfigProvider _configProvider; private readonly ConfigProvider _configProvider;
private readonly HttpProvider _httpProvider; private readonly HttpProvider _httpProvider;
[Inject]
public SabProvider(ConfigProvider configProvider, HttpProvider httpProvider) public SabProvider(ConfigProvider configProvider, HttpProvider httpProvider)
{ {
_configProvider = configProvider; _configProvider = configProvider;

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -23,7 +22,6 @@ namespace NzbDrone.Core.Providers
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public DownloadProvider(SabProvider sabProvider, HistoryProvider historyProvider, public DownloadProvider(SabProvider sabProvider, HistoryProvider historyProvider,
EpisodeProvider episodeProvider, ExternalNotificationProvider externalNotificationProvider, EpisodeProvider episodeProvider, ExternalNotificationProvider externalNotificationProvider,
ConfigProvider configProvider, BlackholeProvider blackholeProvider, ConfigProvider configProvider, BlackholeProvider blackholeProvider,

View File

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -20,7 +19,6 @@ namespace NzbDrone.Core.Providers
private readonly SeasonProvider _seasonProvider; private readonly SeasonProvider _seasonProvider;
private readonly IDatabase _database; private readonly IDatabase _database;
[Inject]
public EpisodeProvider(IDatabase database, TvDbProvider tvDbProviderProvider, public EpisodeProvider(IDatabase database, TvDbProvider tvDbProviderProvider,
SeasonProvider seasonProvider) SeasonProvider seasonProvider)
{ {

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.ExternalNotification; using NzbDrone.Core.Providers.ExternalNotification;
@ -17,7 +16,6 @@ namespace NzbDrone.Core.Providers
private IEnumerable<ExternalNotificationBase> _notifiers; private IEnumerable<ExternalNotificationBase> _notifiers;
[Inject]
public ExternalNotificationProvider(IDatabase database, IEnumerable<ExternalNotificationBase> notifiers) public ExternalNotificationProvider(IDatabase database, IEnumerable<ExternalNotificationBase> notifiers)
{ {
_database = database; _database = database;

View File

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using DataTables.Mvc.Core.Helpers; using DataTables.Mvc.Core.Helpers;
using DataTables.Mvc.Core.Models; using DataTables.Mvc.Core.Models;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -18,7 +17,6 @@ namespace NzbDrone.Core.Providers
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public HistoryProvider(IDatabase database) public HistoryProvider(IDatabase database)
{ {
_database = database; _database = database;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.Indexer
{ {
public class FileSharingTalk : IndexerBase public class FileSharingTalk : IndexerBase
{ {
[Inject]
public FileSharingTalk(HttpProvider httpProvider, ConfigProvider configProvider) public FileSharingTalk(HttpProvider httpProvider, ConfigProvider configProvider)
: base(httpProvider, configProvider) : base(httpProvider, configProvider)
{ {

View File

@ -4,7 +4,6 @@ using System.Linq;
using System.Net; using System.Net;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NLog; using NLog;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
@ -21,7 +20,6 @@ namespace NzbDrone.Core.Providers.Indexer
protected static readonly Regex TitleSearchRegex = new Regex(@"[\W]", RegexOptions.IgnoreCase | RegexOptions.Compiled); protected static readonly Regex TitleSearchRegex = new Regex(@"[\W]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
protected static readonly Regex RemoveThe = new Regex(@"^the\s", RegexOptions.IgnoreCase | RegexOptions.Compiled); protected static readonly Regex RemoveThe = new Regex(@"^the\s", RegexOptions.IgnoreCase | RegexOptions.Compiled);
[Inject]
protected IndexerBase(HttpProvider httpProvider, ConfigProvider configProvider) protected IndexerBase(HttpProvider httpProvider, ConfigProvider configProvider)
{ {
_httpProvider = httpProvider; _httpProvider = httpProvider;

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -13,7 +12,6 @@ namespace NzbDrone.Core.Providers.Indexer
{ {
private readonly NewznabProvider _newznabProvider; private readonly NewznabProvider _newznabProvider;
[Inject]
public Newznab(HttpProvider httpProvider, ConfigProvider configProvider, NewznabProvider newznabProvider) public Newznab(HttpProvider httpProvider, ConfigProvider configProvider, NewznabProvider newznabProvider)
: base(httpProvider, configProvider) : base(httpProvider, configProvider)
{ {

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.Indexer
{ {
public class NzbClub : IndexerBase public class NzbClub : IndexerBase
{ {
[Inject]
public NzbClub(HttpProvider httpProvider, ConfigProvider configProvider) public NzbClub(HttpProvider httpProvider, ConfigProvider configProvider)
: base(httpProvider, configProvider) : base(httpProvider, configProvider)
{ {

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.Indexer
{ {
public class NzbIndex : IndexerBase public class NzbIndex : IndexerBase
{ {
[Inject]
public NzbIndex(HttpProvider httpProvider, ConfigProvider configProvider) public NzbIndex(HttpProvider httpProvider, ConfigProvider configProvider)
: base(httpProvider, configProvider) : base(httpProvider, configProvider)
{ {

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.Indexer
{ {
public class NzbsRUs : IndexerBase public class NzbsRUs : IndexerBase
{ {
[Inject]
public NzbsRUs(HttpProvider httpProvider, ConfigProvider configProvider) : base(httpProvider, configProvider) public NzbsRUs(HttpProvider httpProvider, ConfigProvider configProvider) : base(httpProvider, configProvider)
{ {
} }

View File

@ -6,7 +6,6 @@ using System.ServiceModel.Syndication;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Newtonsoft.Json; using Newtonsoft.Json;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Model.Nzbx; using NzbDrone.Core.Model.Nzbx;
@ -16,7 +15,6 @@ namespace NzbDrone.Core.Providers.Indexer
{ {
class Nzbx : IndexerBase class Nzbx : IndexerBase
{ {
[Inject]
public Nzbx(HttpProvider httpProvider, ConfigProvider configProvider) public Nzbx(HttpProvider httpProvider, ConfigProvider configProvider)
: base(httpProvider, configProvider) : base(httpProvider, configProvider)
{ {

View File

@ -4,7 +4,6 @@ using System.Linq;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -13,7 +12,6 @@ namespace NzbDrone.Core.Providers.Indexer
{ {
class Omgwtfnzbs : IndexerBase class Omgwtfnzbs : IndexerBase
{ {
[Inject]
public Omgwtfnzbs(HttpProvider httpProvider, ConfigProvider configProvider) public Omgwtfnzbs(HttpProvider httpProvider, ConfigProvider configProvider)
: base(httpProvider, configProvider) : base(httpProvider, configProvider)
{ {

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ServiceModel.Syndication; using System.ServiceModel.Syndication;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -11,7 +10,6 @@ namespace NzbDrone.Core.Providers.Indexer
{ {
public class Wombles : IndexerBase public class Wombles : IndexerBase
{ {
[Inject]
public Wombles(HttpProvider httpProvider, ConfigProvider configProvider) : base(httpProvider, configProvider) public Wombles(HttpProvider httpProvider, ConfigProvider configProvider) : base(httpProvider, configProvider)
{ {
} }

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Providers.Indexer; using NzbDrone.Core.Providers.Indexer;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -16,7 +15,6 @@ namespace NzbDrone.Core.Providers
private IEnumerable<IndexerBase> _indexers; private IEnumerable<IndexerBase> _indexers;
[Inject]
public IndexerProvider(IDatabase database, IEnumerable<IndexerBase> indexers) public IndexerProvider(IDatabase database, IEnumerable<IndexerBase> indexers)
{ {
_database = database; _database = database;

View File

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Helpers; using NzbDrone.Core.Helpers;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -20,7 +19,6 @@ namespace NzbDrone.Core.Providers
private readonly IDatabase _database; private readonly IDatabase _database;
private readonly EpisodeProvider _episodeProvider; private readonly EpisodeProvider _episodeProvider;
[Inject]
public MediaFileProvider(EpisodeProvider episodeProvider, ConfigProvider configProvider, IDatabase database) public MediaFileProvider(EpisodeProvider episodeProvider, ConfigProvider configProvider, IDatabase database)
{ {
_episodeProvider = episodeProvider; _episodeProvider = episodeProvider;

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.ExternalNotification; using NzbDrone.Core.Providers.ExternalNotification;
@ -20,7 +19,6 @@ namespace NzbDrone.Core.Providers
private IEnumerable<MetadataBase> _metadataProviders; private IEnumerable<MetadataBase> _metadataProviders;
private readonly TvDbProvider _tvDbProvider; private readonly TvDbProvider _tvDbProvider;
[Inject]
public MetadataProvider(IDatabase database, IEnumerable<MetadataBase> metadataProviders, public MetadataProvider(IDatabase database, IEnumerable<MetadataBase> metadataProviders,
TvDbProvider tvDbProvider) TvDbProvider tvDbProvider)
{ {

View File

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using Ninject;
using NLog; using NLog;
using NzbDrone.Core.Providers.Indexer; using NzbDrone.Core.Providers.Indexer;
using NzbDrone.Core.Repository; using NzbDrone.Core.Repository;
@ -15,7 +14,6 @@ namespace NzbDrone.Core.Providers
private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private readonly IDatabase _database; private readonly IDatabase _database;
[Inject]
public NewznabProvider(IDatabase database) public NewznabProvider(IDatabase database)
{ {
_database = database; _database = database;

View File

@ -5,7 +5,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Xml.Linq; using System.Xml.Linq;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
@ -17,7 +16,6 @@ namespace NzbDrone.Core.Providers
private readonly ConfigProvider _configProvider; private readonly ConfigProvider _configProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public PlexProvider(HttpProvider httpProvider, ConfigProvider configProvider) public PlexProvider(HttpProvider httpProvider, ConfigProvider configProvider)
{ {
_httpProvider = httpProvider; _httpProvider = httpProvider;

View File

@ -3,7 +3,6 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using NLog; using NLog;
using Ninject;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
@ -19,7 +18,6 @@ namespace NzbDrone.Core.Providers
private readonly SeriesProvider _seriesProvider; private readonly SeriesProvider _seriesProvider;
private readonly MetadataProvider _metadataProvider; private readonly MetadataProvider _metadataProvider;
[Inject]
public PostDownloadProvider(DiskProvider diskProvider, DiskScanProvider diskScanProvider, public PostDownloadProvider(DiskProvider diskProvider, DiskScanProvider diskScanProvider,
SeriesProvider seriesProvider, MetadataProvider metadataProvider) SeriesProvider seriesProvider, MetadataProvider metadataProvider)
{ {

Some files were not shown because too many files have changed in this diff Show More