fixed padding and filtered missing hashes
Cette révision appartient à :
Parent
b557a36c83
révision
b3bcda5ffa
2 fichiers modifiés avec 7 ajouts et 6 suppressions
|
@ -21,7 +21,7 @@ nav#mainmenu a {
|
|||
color: white;
|
||||
}
|
||||
div#container {
|
||||
padding-top: 7rem;
|
||||
padding-top: 10rem;
|
||||
}
|
||||
|
||||
body {
|
||||
|
|
11
models.go
11
models.go
|
@ -131,13 +131,14 @@ func getTorrentsOrderBy(parameters *WhereParams, orderBy string, limit int, offs
|
|||
var torrents []Torrents
|
||||
var dbQuery *gorm.DB
|
||||
var count int
|
||||
conditions := "torrent_hash is not null" //filter out broken entries
|
||||
var params []interface{}
|
||||
if parameters != nil { // if there is where parameters
|
||||
db.Model(&torrents).Where(parameters.conditions, parameters.params...).Count(&count)
|
||||
dbQuery = db.Model(&torrents).Where(parameters.conditions, parameters.params...)
|
||||
} else {
|
||||
db.Model(&torrents).Count(&count)
|
||||
dbQuery = db.Model(&torrents)
|
||||
conditions += " AND " + parameters.conditions
|
||||
params = parameters.params
|
||||
}
|
||||
db.Model(&torrents).Where(conditions, params...).Count(&count)
|
||||
dbQuery = db.Model(&torrents).Where(conditions, params...)
|
||||
|
||||
if orderBy == "" {
|
||||
orderBy = "torrent_id DESC"
|
||||
|
|
Référencer dans un nouveau ticket