Fix #570 2
Cette révision appartient à :
Parent
3d089c849a
révision
88bf3c0573
1 fichiers modifiés avec 12 ajouts et 5 suppressions
|
@ -116,22 +116,22 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
|
|||
search.Sort = common.Size
|
||||
orderBy += "filesize"
|
||||
// avoid sorting completely breaking on postgres
|
||||
search.NotNull = "filesize IS NOT NULL"
|
||||
search.NotNull = ""
|
||||
break
|
||||
case "5":
|
||||
search.Sort = common.Seeders
|
||||
orderBy += "seeders"
|
||||
search.NotNull = "seeders IS NOT NULL"
|
||||
search.NotNull = ""
|
||||
break
|
||||
case "6":
|
||||
search.Sort = common.Leechers
|
||||
orderBy += "leechers"
|
||||
search.NotNull = "leechers IS NOT NULL"
|
||||
search.NotNull = ""
|
||||
break
|
||||
case "7":
|
||||
search.Sort = common.Completed
|
||||
orderBy += "completed"
|
||||
search.NotNull = "completed IS NOT NULL"
|
||||
search.NotNull = ""
|
||||
break
|
||||
default:
|
||||
search.Sort = common.ID
|
||||
|
@ -144,9 +144,16 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
|
|||
case "true":
|
||||
search.Order = true
|
||||
orderBy += "asc"
|
||||
if db.ORM.Dialect().GetName() == "postgres" {
|
||||
orderBy += " NULLS FIRST"
|
||||
}
|
||||
default:
|
||||
orderBy += "desc"
|
||||
}
|
||||
if db.ORM.Dialect().GetName() == "postgres" {
|
||||
orderBy += " NULLS LAST"
|
||||
}
|
||||
}
|
||||
|
||||
parameters := serviceBase.WhereParams{
|
||||
Params: make([]interface{}, 0, 64),
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket