diff --git a/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs b/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs index 0aa9fcf280..9c96a4dff1 100644 --- a/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs +++ b/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs @@ -20,12 +20,14 @@ namespace NzbDrone.Core.ImportLists public abstract class HttpImportListBase : ImportListBase where TSettings : IProviderConfig, new() { + protected const int MaxNumResultsPerQuery = 1000; + protected readonly IHttpClient _httpClient; public override bool Enabled => true; - public bool SupportsPaging => PageSize > 20; + public override bool EnableAuto => false; - public virtual int PageSize => 20; + public virtual int PageSize => 0; public virtual TimeSpan RateLimit => TimeSpan.FromSeconds(2); public abstract IImportListRequestGenerator GetRequestGenerator(); @@ -71,6 +73,16 @@ protected virtual ImportListFetchResult FetchMovies(Func= MaxNumResultsPerQuery) + { + break; + } + + if (!IsFullPage(page)) + { + break; + } } movies.AddRange(pagedMovies.Where(IsValidItem)); @@ -161,6 +173,11 @@ protected virtual bool IsValidItem(ImportListMovie listItem) return true; } + protected virtual bool IsFullPage(IList page) + { + return PageSize != 0 && page.Count >= PageSize; + } + protected virtual IList FetchPage(ImportListRequest request, IParseImportListResponse parser) { var response = FetchImportListResponse(request);