Minor optimization about fetching old comments
Cette révision appartient à :
Parent
c0be570e54
révision
72ab7a490c
1 fichiers modifiés avec 1 ajouts et 1 suppressions
|
@ -71,7 +71,7 @@ func GetTorrentById(id string) (torrent model.Torrent, err error) {
|
||||||
torrent.Uploader = new(model.User)
|
torrent.Uploader = new(model.User)
|
||||||
db.ORM.Where("user_id = ?", torrent.UploaderID).Find(torrent.Uploader)
|
db.ORM.Where("user_id = ?", torrent.UploaderID).Find(torrent.Uploader)
|
||||||
torrent.OldUploader = ""
|
torrent.OldUploader = ""
|
||||||
if torrent.ID <= config.LastOldTorrentID {
|
if torrent.ID <= config.LastOldTorrentID && torrent.UploaderID == 0 {
|
||||||
var tmp model.UserUploadsOld
|
var tmp model.UserUploadsOld
|
||||||
if !db.ORM.Where("torrent_id = ?", torrent.ID).Find(&tmp).RecordNotFound() {
|
if !db.ORM.Where("torrent_id = ?", torrent.ID).Find(&tmp).RecordNotFound() {
|
||||||
torrent.OldUploader = tmp.Username
|
torrent.OldUploader = tmp.Username
|
||||||
|
|
Référencer dans un nouveau ticket