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;
|
color: white;
|
||||||
}
|
}
|
||||||
div#container {
|
div#container {
|
||||||
padding-top: 7rem;
|
padding-top: 10rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
|
11
models.go
11
models.go
|
@ -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"
|
||||||
|
|
Référencer dans un nouveau ticket