Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Mark torrents from trusted users as trusted

Cette révision appartient à :
sfan5 2017-05-10 21:41:47 +02:00
Parent d178ab23b6
révision c5052a11c3

Voir le fichier

@ -33,12 +33,16 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
if err != nil {
fmt.Printf("error %+v\n", err)
}
status := 1 // normal
if user.Status == 1 {
status = 3 // mark as trusted if user is trusted
}
//add to db and redirect depending on result
torrent := model.Torrent{
Name: uploadForm.Name,
Category: uploadForm.CategoryID,
SubCategory: uploadForm.SubCategoryID,
Status: 1,
Status: status,
Hash: uploadForm.Infohash,
Date: time.Now(),
Filesize: uploadForm.Filesize,