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

constantly preload filelists

Cette révision appartient à :
kilo 2017-11-08 10:25:29 +01:00 révisé par GitHub
Parent b6b1414647
révision 1d8a3249c4
Signature inconnue de Forgejo
ID de la clé GPG: 4AEE18F83AFDEB23
1 fichiers modifiés avec 2 ajouts et 4 suppressions

Voir le fichier

@ -39,10 +39,8 @@ func FindByID(id uint) (*models.Torrent, error) {
}
tmp := models.ORM.Where("torrent_id = ?", id).Preload("Scrape").Preload("Uploader").Preload("Comments")
if id > config.Get().Models.LastOldTorrentID {
tmp = tmp.Preload("FileList")
}
tmp := models.ORM.Where("torrent_id = ?", id).Preload("Scrape").Preload("Uploader").Preload("Comments").Preload("FileList")
if id <= config.Get().Models.LastOldTorrentID && !config.IsSukebei() {
// only preload old comments if they could actually exist
tmp = tmp.Preload("OldComments")