Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

fixed padding and filtered missing hashes

Cette révision appartient à :
ayame-git 2017-05-05 10:18:24 +03:00
Parent 6adce8eda9
révision d053dab402
2 fichiers modifiés avec 7 ajouts et 6 suppressions

Voir le fichier

@ -21,7 +21,7 @@ nav#mainmenu a {
color: white; color: white;
} }
div#container { div#container {
padding-top: 7rem; padding-top: 10rem;
} }
body { body {

Voir le fichier

@ -131,13 +131,14 @@ func getTorrentsOrderBy(parameters *WhereParams, orderBy string, limit int, offs
var torrents []Torrents var torrents []Torrents
var dbQuery *gorm.DB var dbQuery *gorm.DB
var count int var count int
conditions := "torrent_hash is not null" //filter out broken entries
var params []interface{}
if parameters != nil { // if there is where parameters if parameters != nil { // if there is where parameters
db.Model(&torrents).Where(parameters.conditions, parameters.params...).Count(&count) conditions += " AND " + parameters.conditions
dbQuery = db.Model(&torrents).Where(parameters.conditions, parameters.params...) params = parameters.params
} else {
db.Model(&torrents).Count(&count)
dbQuery = db.Model(&torrents)
} }
db.Model(&torrents).Where(conditions, params...).Count(&count)
dbQuery = db.Model(&torrents).Where(conditions, params...)
if orderBy == "" { if orderBy == "" {
orderBy = "torrent_id DESC" orderBy = "torrent_id DESC"