cardigann: fix .query.season (#12857)

Co-authored-by: Qstick <qstick@users.noreply.github.com>
This commit is contained in:
ilike2burnthing 2022-01-19 23:53:45 +00:00 committed by GitHub
parent 3afd31ea1c
commit 67e054468d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 9 deletions

View File

@ -63,10 +63,19 @@ search:
paths:
# https://hdinnovations.github.io/UNIT3D-Community-Edition-Docs/api_endpoints.html
# https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/app/Http/Controllers/API/TorrentController.php
- path: "/api/torrents/filter?api_token={{ .Config.apikey }}&name={{ if .Query.IMDBID }}{{ else }}{{ .Keywords }}{{ end }}{{ if .Query.TMDBID }}&tmdbId={{ .Query.TMDBID }}{{ else }}{{ end }}{{ if .Query.IMDBIDShort }}&imdbId={{ .Query.IMDBIDShort }}{{ else }}{{ end }}{{ if .Query.TVDBID }}&tvdbId={{ .Query.TVDBID }}{{ else }}{{ end }}&sortField={{ .Config.sort }}&sortDirection={{ .Config.type }}&perPage=100&page=1{{ range .Categories }}&categories[]={{.}}{{end}}{{ if .Config.freeleech }}&free=1{{ else }}{{ end }}"
- path: "/api/torrents/filter"
response:
type: json
attribute: attributes
inputs:
# if we have an id based search, add Season and Episode as query in name for UNIT3D < v6. Else pass S/E Params for UNIT3D >= v6
api_token: "{{ .Config.apikey }}"
name: "{{ .Keywords }}"
$raw: "{{ if .Query.Season }}&seasonNumber={{ .Query.Season }}{{ else }}{{ end }}{{ if .Query.Ep }}&episodeNumber={{ .Query.Ep }}{{ else }}{{ end }}{{ if .Query.TMDBID }}&tmdbId={{ .Query.TMDBID }}{{ else }}{{ end }}{{ if .Query.IMDBIDShort }}&imdbId={{ .Query.IMDBIDShort }}{{ else }}{{ end }}{{ if .Query.TVDBID }}&tvdbId={{ .Query.TVDBID }}{{ else }}{{ end }}{{ range .Categories }}&categories[]={{.}}{{end}}{{ if .Config.freeleech }}&free=1{{ else }}{{ end }}"
sortField: "{{ .Config.sort }}"
sortDirection: "{{ .Config.type }}"
perPage: 100
page: 1
keywordsfilters:
- name: re_replace
@ -134,4 +143,4 @@ search:
minimumseedtime:
# 7 day (as seconds = 7 x 24 x 60 x 60)
text: 604800
# json UNIT3D 5.3.1b
# json UNIT3D 6.0.0 beta

View File

@ -1259,19 +1259,19 @@ namespace Jackett.Common.Indexers
variables[".Query.Q"] = query.SearchTerm;
variables[".Query.Series"] = null;
variables[".Query.Ep"] = query.Episode;
variables[".Query.Season"] = query.Season;
variables[".Query.Season"] = query.Season > 0 ? query.Season.ToString() : null;
variables[".Query.Movie"] = null;
variables[".Query.Year"] = query.Year.ToString();
variables[".Query.Limit"] = query.Limit.ToString();
variables[".Query.Offset"] = query.Offset.ToString();
variables[".Query.Year"] = query.Year?.ToString() ?? null;
variables[".Query.Limit"] = query.Limit.ToString() ?? null;
variables[".Query.Offset"] = query.Offset.ToString() ?? null;
variables[".Query.Extended"] = query.Extended.ToString();
variables[".Query.Categories"] = query.Categories;
variables[".Query.APIKey"] = query.ApiKey;
variables[".Query.TVDBID"] = query.TvdbID.ToString();
variables[".Query.TVRageID"] = query.RageID;
variables[".Query.TVDBID"] = query.TvdbID?.ToString() ?? null;
variables[".Query.TVRageID"] = query.RageID?.ToString() ?? null;
variables[".Query.IMDBID"] = query.ImdbID;
variables[".Query.IMDBIDShort"] = query.ImdbIDShort;
variables[".Query.TMDBID"] = query.TmdbID.ToString();
variables[".Query.TMDBID"] = query.TmdbID?.ToString() ?? null;
variables[".Query.TVMazeID"] = null;
variables[".Query.TraktID"] = null;
variables[".Query.Album"] = query.Album;