1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00

Renamed IndexerProviderBase to IndexerBase since its no longer a provider

This commit is contained in:
kay.one 2011-05-19 21:21:18 -07:00
parent 3e1ff7e96e
commit 53e6b60382
11 changed files with 42 additions and 42 deletions

View File

@ -40,7 +40,7 @@ public void parse_feed_xml(string fileName, int warns)
.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 @@ public void Init_indexer_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 @@ public void unmapped_series_shouldnt_call_any_providers()
.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 @@ protected override string NzbDownloadUrl(SyndicationItem item)
}
}
public class TestUrlIndexer : IndexerProviderBase
public class TestUrlIndexer : IndexerBase
{
public TestUrlIndexer(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider)
: base(httpProvider, configProvider, indexerProvider)
@ -199,7 +199,7 @@ protected override string NzbDownloadUrl(SyndicationItem item)
}
}
public class CustomParserIndexer : IndexerProviderBase
public class CustomParserIndexer : IndexerBase
{
public CustomParserIndexer(HttpProvider httpProvider, ConfigProvider configProvider, IndexerProvider indexerProvider)
: base(httpProvider, configProvider, indexerProvider)

View File

@ -120,11 +120,11 @@ public static void BindKernel()
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());
}

View File

@ -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" />

View File

@ -9,14 +9,14 @@
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;

View File

@ -7,9 +7,9 @@
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)
{
}

View File

@ -9,9 +9,9 @@
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)
{
}

View File

@ -8,9 +8,9 @@
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)
{
}

View File

@ -8,9 +8,9 @@
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)
{
}

View File

@ -53,7 +53,7 @@ public virtual IndexerSetting GetSettings(int id)
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 @@ public virtual void InitializeIndexers(IList<IndexerProviderBase> indexers)
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);

View File

@ -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;
}

View File

@ -93,10 +93,10 @@ public ActionResult Indexers()
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 @@ public ActionResult SaveIndexers(IndexerSettingsModel data)
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);