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

Fix Search by ID (#1592)

torrent_id is a column from both torrents and scrapes tables. So you have to specify for which table you want to filter torrent_id.
Fix #1589
Cette révision appartient à :
akuma06 2017-09-18 15:43:07 +02:00 révisé par kilo
Parent 33e90093b7
révision d7d737d48b
2 fichiers modifiés avec 3 ajouts et 3 suppressions

Voir le fichier

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

Voir le fichier

@ -387,11 +387,11 @@ func (p *TorrentParam) toDBQuery(c *gin.Context) *Query {
}
if p.FromID != 0 {
query.Append("torrent_id > ?", p.FromID)
query.Append("torrents.torrent_id > ?", p.FromID)
}
if len(p.TorrentID) > 0 {
for _, id := range p.TorrentID {
query.Append("torrent_id = ?", id)
query.Append("torrents.torrent_id = ?", id)
}
}
if p.FromDate != "" {