Renamed IndexerProviderBase to IndexerBase since its no longer a provider

pull/2/head
kay.one 14 years ago
parent 3e1ff7e96e
commit 53e6b60382

@ -40,7 +40,7 @@ namespace NzbDrone.Core.Test
.Setup(c => c.GetSettings(It.IsAny<Type>()))
.Returns(fakeSettings);
var parseResults = mocker.Resolve<MockIndexerProvider>().Fetch();
var parseResults = mocker.Resolve<MockIndexer>().Fetch();
Assert.IsNotEmpty(parseResults);
@ -127,7 +127,7 @@ namespace NzbDrone.Core.Test
//Act
var indexerProvider = mocker.Resolve<IndexerProvider>();
indexerProvider.InitializeIndexers(new List<IndexerProviderBase> { mocker.Resolve<MockIndexerProvider>() });
indexerProvider.InitializeIndexers(new List<IndexerBase> { mocker.Resolve<MockIndexer>() });
var indexers = indexerProvider.All();
//Assert
@ -142,14 +142,14 @@ namespace NzbDrone.Core.Test
.Setup(c => c.FindSeries(It.IsAny<String>()))
.Returns<Series>(null);
var indexer = mocker.Resolve<MockIndexerProvider>();
var indexer = mocker.Resolve<MockIndexer>();
//indexer.ProcessItem(new SyndicationItem { Title = new TextSyndicationContent("Adventure.Inc.S01E18.DVDRip.XviD-OSiTV") });
}
}
public class MockIndexerProvider : IndexerProviderBase
public class MockIndexer : IndexerBase
{
public MockIndexerProvider(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider)
public MockIndexer(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider)
: base(httpProvider, configProvider, indexerProvider)
{
}
@ -176,7 +176,7 @@ namespace NzbDrone.Core.Test
}
}
public class TestUrlIndexer : IndexerProviderBase
public class TestUrlIndexer : IndexerBase
{
public TestUrlIndexer(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider)
: base(httpProvider, configProvider, indexerProvider)
@ -199,7 +199,7 @@ namespace NzbDrone.Core.Test
}
}
public class CustomParserIndexer : IndexerProviderBase
public class CustomParserIndexer : IndexerBase
{
public CustomParserIndexer(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider)
: base(httpProvider, configProvider, indexerProvider)

@ -120,11 +120,11 @@ namespace NzbDrone.Core
private static void BindIndexers()
{
_kernel.Bind<IndexerProviderBase>().To<NzbsOrgProvider>().InSingletonScope();
_kernel.Bind<IndexerProviderBase>().To<NzbMatrixProvider>().InSingletonScope();
_kernel.Bind<IndexerProviderBase>().To<NzbsRUsProvider>().InSingletonScope();
_kernel.Bind<IndexerProviderBase>().To<NewzbinProvider>().InSingletonScope();
var indexers = _kernel.GetAll<IndexerProviderBase>();
_kernel.Bind<IndexerBase>().To<NzbsOrg>().InSingletonScope();
_kernel.Bind<IndexerBase>().To<NzbMatrix>().InSingletonScope();
_kernel.Bind<IndexerBase>().To<NzbsRUs>().InSingletonScope();
_kernel.Bind<IndexerBase>().To<Newzbin>().InSingletonScope();
var indexers = _kernel.GetAll<IndexerBase>();
_kernel.Get<IndexerProvider>().InitializeIndexers(indexers.ToList());
}

@ -175,13 +175,13 @@
<Compile Include="Providers\Indexer\IsNeededProvider.cs" />
<Compile Include="Providers\Indexer\SyndicationFeedXmlReader.cs" />
<Compile Include="Providers\AutoConfigureProvider.cs" />
<Compile Include="Providers\Indexer\NzbMatrixProvider.cs" />
<Compile Include="Providers\Indexer\NzbMatrix.cs" />
<Compile Include="Providers\Jobs\DeleteSeriesJob.cs" />
<Compile Include="Providers\Jobs\MediaFileScanJob.cs" />
<Compile Include="Providers\Jobs\NewSeriesUpdate.cs" />
<Compile Include="Providers\Jobs\JobProvider.cs" />
<Compile Include="Providers\Indexer\NewzbinProvider.cs" />
<Compile Include="Providers\Indexer\NzbsRUsProvider.cs" />
<Compile Include="Providers\Indexer\Newzbin.cs" />
<Compile Include="Providers\Indexer\NzbsRUs.cs" />
<Compile Include="Providers\Jobs\IJob.cs" />
<Compile Include="Providers\Jobs\RssSyncJob.cs" />
<Compile Include="Providers\Jobs\UpdateInfoJob.cs" />
@ -197,9 +197,9 @@
<Compile Include="Model\SceneNameModel.cs" />
<Compile Include="Model\SeasonParseResult.cs" />
<Compile Include="Model\UpcomingEpisodesModel.cs" />
<Compile Include="Providers\Indexer\IndexerProviderBase.cs" />
<Compile Include="Providers\Indexer\IndexerBase.cs" />
<Compile Include="Providers\ExternalNotificationProvider.cs" />
<Compile Include="Providers\Indexer\NzbsOrgProvider.cs" />
<Compile Include="Providers\Indexer\NzbsOrg.cs" />
<Compile Include="Providers\HistoryProvider.cs" />
<Compile Include="Providers\BacklogProvider.cs" />
<Compile Include="Providers\IndexerProvider.cs" />

@ -9,14 +9,14 @@ using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers.Indexer
{
public abstract class IndexerProviderBase
public abstract class IndexerBase
{
protected readonly Logger _logger;
private readonly HttpProvider _httpProvider;
protected readonly ConfigProvider _configProvider;
private readonly IndexerProvider _indexerProvider;
protected IndexerProviderBase(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider)
protected IndexerBase(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider)
{
_httpProvider = httpProvider;
_configProvider = configProvider;

@ -7,9 +7,9 @@ using NzbDrone.Core.Providers.ExternalNotification;
namespace NzbDrone.Core.Providers.Indexer
{
public class NewzbinProvider : IndexerProviderBase
public class Newzbin : IndexerBase
{
public NewzbinProvider(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider) : base(httpProvider, configProvider, indexerProvider)
public Newzbin(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider) : base(httpProvider, configProvider, indexerProvider)
{
}

@ -9,9 +9,9 @@ using SubSonic.Repository;
namespace NzbDrone.Core.Providers.Indexer
{
public class NzbMatrixProvider : IndexerProviderBase
public class NzbMatrix : IndexerBase
{
public NzbMatrixProvider(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider) : base(httpProvider, configProvider, indexerProvider)
public NzbMatrix(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider) : base(httpProvider, configProvider, indexerProvider)
{
}

@ -8,9 +8,9 @@ using SubSonic.Repository;
namespace NzbDrone.Core.Providers.Indexer
{
public class NzbsOrgProvider : IndexerProviderBase
public class NzbsOrg : IndexerBase
{
public NzbsOrgProvider(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider) : base(httpProvider, configProvider, indexerProvider)
public NzbsOrg(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider) : base(httpProvider, configProvider, indexerProvider)
{
}

@ -8,9 +8,9 @@ using SubSonic.Repository;
namespace NzbDrone.Core.Providers.Indexer
{
public class NzbsRUsProvider : IndexerProviderBase
public class NzbsRUs : IndexerBase
{
public NzbsRUsProvider(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider) : base(httpProvider, configProvider, indexerProvider)
public NzbsRUs(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider) : base(httpProvider, configProvider, indexerProvider)
{
}

@ -53,7 +53,7 @@ namespace NzbDrone.Core.Providers
return _repository.Single<IndexerSetting>(s => s.Id == id);
}
public virtual void InitializeIndexers(IList<IndexerProviderBase> indexers)
public virtual void InitializeIndexers(IList<IndexerBase> indexers)
{
Logger.Info("Initializing indexers. Count {0}", indexers.Count);
@ -61,14 +61,14 @@ namespace NzbDrone.Core.Providers
foreach (var feedProvider in indexers)
{
IndexerProviderBase indexerProviderLocal = feedProvider;
if (!currentIndexers.Exists(c => c.IndexProviderType == indexerProviderLocal.GetType().ToString()))
IndexerBase indexerLocal = feedProvider;
if (!currentIndexers.Exists(c => c.IndexProviderType == indexerLocal.GetType().ToString()))
{
var settings = new IndexerSetting()
{
Enable = false,
IndexProviderType = indexerProviderLocal.GetType().ToString(),
Name = indexerProviderLocal.Name
IndexProviderType = indexerLocal.GetType().ToString(),
Name = indexerLocal.Name
};
SaveSettings(settings);

@ -8,12 +8,12 @@ namespace NzbDrone.Core.Providers.Jobs
{
public class RssSyncJob : IJob
{
private readonly IEnumerable<IndexerProviderBase> _indexers;
private readonly IEnumerable<IndexerBase> _indexers;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public RssSyncJob(IEnumerable<IndexerProviderBase> indexers)
public RssSyncJob(IEnumerable<IndexerBase> indexers)
{
_indexers = indexers;
}

@ -93,10 +93,10 @@ namespace NzbDrone.Web.Controllers
NewzbinUsername = _configProvider.NewzbinUsername,
NewzbinPassword = _configProvider.NewzbinPassword,
NzbsOrgEnabled = _indexerProvider.GetSettings(typeof(NzbsOrgProvider)).Enable,
NzbMatrixEnabled = _indexerProvider.GetSettings(typeof(NzbMatrixProvider)).Enable,
NzbsRUsEnabled = _indexerProvider.GetSettings(typeof(NzbsRUsProvider)).Enable,
NewzbinEnabled = _indexerProvider.GetSettings(typeof(NewzbinProvider)).Enable
NzbsOrgEnabled = _indexerProvider.GetSettings(typeof(NzbsOrg)).Enable,
NzbMatrixEnabled = _indexerProvider.GetSettings(typeof(NzbMatrix)).Enable,
NzbsRUsEnabled = _indexerProvider.GetSettings(typeof(NzbsRUs)).Enable,
NewzbinEnabled = _indexerProvider.GetSettings(typeof(Newzbin)).Enable
});
}
@ -382,19 +382,19 @@ namespace NzbDrone.Web.Controllers
if (ModelState.IsValid)
{
var nzbsOrgSettings = _indexerProvider.GetSettings(typeof(NzbsOrgProvider));
var nzbsOrgSettings = _indexerProvider.GetSettings(typeof(NzbsOrg));
nzbsOrgSettings.Enable = data.NzbsOrgEnabled;
_indexerProvider.SaveSettings(nzbsOrgSettings);
var nzbMatrixSettings = _indexerProvider.GetSettings(typeof(NzbMatrixProvider));
var nzbMatrixSettings = _indexerProvider.GetSettings(typeof(NzbMatrix));
nzbMatrixSettings.Enable = data.NzbMatrixEnabled;
_indexerProvider.SaveSettings(nzbMatrixSettings);
var nzbsRUsSettings = _indexerProvider.GetSettings(typeof(NzbsRUsProvider));
var nzbsRUsSettings = _indexerProvider.GetSettings(typeof(NzbsRUs));
nzbsRUsSettings.Enable = data.NzbsRUsEnabled;
_indexerProvider.SaveSettings(nzbsRUsSettings);
var newzbinSettings = _indexerProvider.GetSettings(typeof(NewzbinProvider));
var newzbinSettings = _indexerProvider.GetSettings(typeof(Newzbin));
newzbinSettings.Enable = data.NewzbinEnabled;
_indexerProvider.SaveSettings(newzbinSettings);

Loading…
Cancel
Save