cardigann: check for page size

This commit is contained in:
Bogdan 2023-05-01 21:10:16 +03:00
parent f59cc953ec
commit dc3e068066
4 changed files with 20 additions and 3 deletions

View File

@ -43,6 +43,8 @@ legacylinks:
- https://1337x.unblockit.click/
caps:
limitsDefault: 80
limitsMax: 80
categorymappings:
# Anime
- {id: 28, cat: TV/Anime, desc: "Anime/Anime"}
@ -181,6 +183,9 @@ download:
attribute: href
search:
pageSize: 20
pageable: "{{ if or .Query.Album .Query.Artist .Keywords }}true{{ else }}false{{ end }}"
paths:
# present first page of movies tv and music results if there are no search parms supplied (20 hits per page)
- path: "{{ if or .Query.Album .Query.Artist .Keywords }}sort-search{{ else }}cat/Movies{{ end }}{{ if or .Query.Album .Query.Artist }}/{{ or .Query.Album .Query.Artist }}{{ else }}/{{ .Keywords }}{{ end }}{{ if or .Query.Album .Query.Artist .Keywords }}/{{ else }}{{ end }}{{ .Config.sort }}/{{ .Config.type }}/1/"

View File

@ -495,7 +495,14 @@
"minimum": 1
},
"pageable": {
"type": "boolean"
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
}
]
},
"path": {
"type": "string"

View File

@ -1359,6 +1359,11 @@ namespace Jackett.Common.Indexers
var pageSize = PageSize;
if (!bool.TryParse(applyGoTemplateText(Search.Pageable, variables), out var pageable))
{
pageable = false;
}
// TODO: prepare queries first and then send them parallel
var SearchPaths = Search.Paths;
foreach (var SearchPath in SearchPaths)
@ -1743,7 +1748,7 @@ namespace Jackett.Common.Indexers
pageSize = pageSize == 1 ? releases.Count : pageSize;
if (Search.Pageable && !IsFullPage(releases, pageSize))
if (pageable && !IsFullPage(releases, pageSize))
{
break;
}

View File

@ -140,7 +140,7 @@ namespace Jackett.Common.Models
public class searchBlock
{
public int PageSize { get; set; }
public bool Pageable { get; set; }
public string Pageable { get; set; }
public string Path { get; set; }
public List<searchPathBlock> Paths { get; set; }
public Dictionary<string, List<string>> Headers { get; set; }