Fix search
Cette révision appartient à :
Parent
64fc5b3940
révision
7692df4b29
1 fichiers modifiés avec 2 ajouts et 2 suppressions
|
@ -55,10 +55,10 @@ func GetTorrentById(id string) (model.Torrents, error) {
|
||||||
func GetTorrentsOrderBy(parameters *WhereParams, orderBy string, limit int, offset int) ([]model.Torrents, int) {
|
func GetTorrentsOrderBy(parameters *WhereParams, orderBy string, limit int, offset int) ([]model.Torrents, int) {
|
||||||
var torrents []model.Torrents
|
var torrents []model.Torrents
|
||||||
var count int
|
var count int
|
||||||
conditions := ""
|
conditions := "1" // FIXME
|
||||||
if strings.HasPrefix(orderBy, "filesize") {
|
if strings.HasPrefix(orderBy, "filesize") {
|
||||||
// torrents w/ NULL filesize fuck up the sorting on postgres
|
// torrents w/ NULL filesize fuck up the sorting on postgres
|
||||||
conditions = "filesize IS NOT NULL"
|
conditions += " AND filesize IS NOT NULL"
|
||||||
}
|
}
|
||||||
|
|
||||||
var params []interface{}
|
var params []interface{}
|
||||||
|
|
Référencer dans un nouveau ticket