|
|
|
@ -19,7 +19,13 @@ namespace NzbDrone.Core.Indexers.Torznab
|
|
|
|
|
public override string Name => "Torznab";
|
|
|
|
|
|
|
|
|
|
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
|
|
|
|
public override int PageSize => Math.Min(100, Math.Max(_capabilitiesProvider.GetCapabilities(Settings).DefaultPageSize, _capabilitiesProvider.GetCapabilities(Settings).MaxPageSize));
|
|
|
|
|
public override int PageSize => GetProviderPageSize();
|
|
|
|
|
|
|
|
|
|
public Torznab(INewznabCapabilitiesProvider capabilitiesProvider, IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
|
|
|
|
|
: base(httpClient, indexerStatusService, configService, parsingService, logger)
|
|
|
|
|
{
|
|
|
|
|
_capabilitiesProvider = capabilitiesProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IIndexerRequestGenerator GetRequestGenerator()
|
|
|
|
|
{
|
|
|
|
@ -35,12 +41,6 @@ namespace NzbDrone.Core.Indexers.Torznab
|
|
|
|
|
return new TorznabRssParser();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Torznab(INewznabCapabilitiesProvider capabilitiesProvider, IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
|
|
|
|
|
: base(httpClient, indexerStatusService, configService, parsingService, logger)
|
|
|
|
|
{
|
|
|
|
|
_capabilitiesProvider = capabilitiesProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IndexerDefinition GetDefinition(string name, TorznabSettings settings)
|
|
|
|
|
{
|
|
|
|
|
return new IndexerDefinition
|
|
|
|
@ -147,5 +147,17 @@ namespace NzbDrone.Core.Indexers.Torznab
|
|
|
|
|
|
|
|
|
|
return base.RequestAction(action, query);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int GetProviderPageSize()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return Math.Min(100, Math.Max(_capabilitiesProvider.GetCapabilities(Settings).DefaultPageSize, _capabilitiesProvider.GetCapabilities(Settings).MaxPageSize));
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
return 100;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|