Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix sukebei fromID search (#1722)

* Update sortmode.go

* Update torrentParam.go
Cette révision appartient à :
kilo 2017-11-08 14:41:39 +01:00 révisé par ewhal
Parent 213780f0eb
révision 1bbda2c96a
2 fichiers modifiés avec 4 ajouts et 3 suppressions

Voir le fichier

@ -21,7 +21,7 @@ type SortField struct {
}
var sortFields = []SortField{
{"id", "torrents.torrent_id"},
{"id", config.Get().Models.TorrentsTableName + ".torrent_id"},
{"name.raw", "torrent_name"},
{"date", "date"},
{"downloads", "downloads"},

Voir le fichier

@ -13,6 +13,7 @@ import (
elastic "gopkg.in/olivere/elastic.v5"
"github.com/NyaaPantsu/nyaa/config"
"github.com/NyaaPantsu/nyaa/models"
"github.com/NyaaPantsu/nyaa/models/torrents"
"github.com/NyaaPantsu/nyaa/utils/log"
@ -390,11 +391,11 @@ func (p *TorrentParam) toDBQuery(c *gin.Context) *Query {
}
if p.FromID != 0 {
query.Append("torrents.torrent_id > ?", p.FromID)
query.Append(config.Get().Models.TorrentsTableName + ".torrent_id > ?", p.FromID)
}
if len(p.TorrentID) > 0 {
for _, id := range p.TorrentID {
query.Append("torrents.torrent_id = ?", id)
query.Append(config.Get().Models.TorrentsTableName + ".torrent_id = ?", id)
}
}
if p.FromDate != "" {