Fixed: (Indexers) Add SupportsPagination to prevent fetching the first page multiple times

This commit is contained in:
Bogdan
2023-03-05 18:37:04 +02:00
parent d4c5e39c9c
commit 4348ebe187
22 changed files with 69 additions and 45 deletions

View File

@@ -25,6 +25,7 @@ namespace Prowlarr.Api.V1.Indexers
public bool SupportsRss { get; set; }
public bool SupportsSearch { get; set; }
public bool SupportsRedirect { get; set; }
public bool SupportsPagination { get; set; }
public int AppProfileId { get; set; }
public DownloadProtocol Protocol { get; set; }
public IndexerPrivacy Privacy { get; set; }
@@ -57,9 +58,9 @@ namespace Prowlarr.Api.V1.Indexers
var infoLinkName = definition.ImplementationName;
if (definition.Implementation == typeof(Cardigann).Name)
if (definition.Implementation == nameof(Cardigann))
{
var extraFields = definition.ExtraFields?.Select((x, i) => MapField(x, i)).ToList() ?? new List<Field>();
var extraFields = definition.ExtraFields?.Select(MapField).ToList() ?? new List<Field>();
resource.Fields.AddRange(extraFields);
@@ -79,7 +80,7 @@ namespace Prowlarr.Api.V1.Indexers
infoLinkName = settings.DefinitionFile;
}
resource.InfoLink = string.Format("https://wiki.servarr.com/prowlarr/supported-indexers#{0}", infoLinkName.ToLower().Replace(' ', '-'));
resource.InfoLink = $"https://wiki.servarr.com/prowlarr/supported-indexers#{infoLinkName.ToLower().Replace(' ', '-')}";
resource.AppProfileId = definition.AppProfileId;
resource.IndexerUrls = definition.IndexerUrls;
resource.LegacyUrls = definition.LegacyUrls;
@@ -91,6 +92,7 @@ namespace Prowlarr.Api.V1.Indexers
resource.SupportsRss = definition.SupportsRss;
resource.SupportsSearch = definition.SupportsSearch;
resource.SupportsRedirect = definition.SupportsRedirect;
resource.SupportsPagination = definition.SupportsPagination;
resource.Capabilities = definition.Capabilities.ToResource();
resource.Protocol = definition.Protocol;
resource.Privacy = definition.Privacy;