Fix loading more torrents in conjunction with sorting ( default sorting is broken for now )

This commit is contained in:
Michał Gątkowski 2022-08-10 00:11:00 +02:00
parent 615734fd14
commit 08fd243a20

View File

@ -223,13 +223,7 @@ func (db *postgresDatabase) QueryTorrents(
{{ end }} {{ end }}
FROM torrents FROM torrents
{{ if not .FirstPage }} {{ if not .FirstPage }}
WHERE WHERE {{.OrderOn}} {{GTEorLTE .Ascending}} {{.LastOrderedValue}}
{{ if not .QueryExists }}
{{.OrderOn}}
{{ else }}
similarity(name, '{{ .Query }}') * -1
{{ end }}
{{GTEorLTE .Ascending}} {{.LastOrderedValue}}
{{ if .QueryExists }} {{ if .QueryExists }}
AND AND
{{ end }} {{ end }}