Mark torrents from trusted users as trusted
Cette révision appartient à :
Parent
d178ab23b6
révision
c5052a11c3
1 fichiers modifiés avec 5 ajouts et 1 suppressions
|
@ -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,
|
||||
|
|
Référencer dans un nouveau ticket