Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Cette révision appartient à :
sfan5 2017-05-08 20:10:55 +02:00
Parent 64fc5b3940
révision 7692df4b29

Voir le fichier

@ -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{}