Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Minor optimization about fetching old comments

Cette révision appartient à :
sfan5 2017-05-13 17:30:29 +02:00
Parent c0be570e54
révision 72ab7a490c

Voir le fichier

@ -71,7 +71,7 @@ func GetTorrentById(id string) (torrent model.Torrent, err error) {
torrent.Uploader = new(model.User)
db.ORM.Where("user_id = ?", torrent.UploaderID).Find(torrent.Uploader)
torrent.OldUploader = ""
if torrent.ID <= config.LastOldTorrentID {
if torrent.ID <= config.LastOldTorrentID && torrent.UploaderID == 0 {
var tmp model.UserUploadsOld
if !db.ORM.Where("torrent_id = ?", torrent.ID).Find(&tmp).RecordNotFound() {
torrent.OldUploader = tmp.Username