?
Cette révision appartient à :
révision
d879f76e16
3 fichiers modifiés avec 23 ajouts et 0 suppressions
|
@ -133,10 +133,17 @@ func ApiUploadHandler(w http.ResponseWriter, r *http.Request) {
|
|||
upload.Category, _ = strconv.Atoi(r.FormValue("category"))
|
||||
upload.SubCategory, _ = strconv.Atoi(r.FormValue("sub_category"))
|
||||
upload.Description = r.FormValue("description")
|
||||
<<<<<<< HEAD
|
||||
|
||||
var err error
|
||||
var code int
|
||||
|
||||
=======
|
||||
|
||||
var err error
|
||||
var code int
|
||||
|
||||
>>>>>>> 5a32c00f503906080d518ceea69897f251933ac1
|
||||
filesize, err, code = upload.ValidateMultipartUpload(r)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), code)
|
||||
|
@ -156,8 +163,13 @@ func ApiUploadHandler(w http.ResponseWriter, r *http.Request) {
|
|||
UploaderID: user.ID,
|
||||
Uploader: &user,
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
db.ORM.Create(&torrent)
|
||||
/*if err != nil {
|
||||
=======
|
||||
/*db.ORM.Create(&torrent)
|
||||
if err != nil {
|
||||
>>>>>>> 5a32c00f503906080d518ceea69897f251933ac1
|
||||
util.SendError(w, err, 500)
|
||||
return
|
||||
}*/
|
||||
|
|
|
@ -12,7 +12,10 @@ import (
|
|||
|
||||
"github.com/ewhal/nyaa/model"
|
||||
"github.com/ewhal/nyaa/service"
|
||||
<<<<<<< HEAD
|
||||
"github.com/ewhal/nyaa/service/upload"
|
||||
=======
|
||||
>>>>>>> 5a32c00f503906080d518ceea69897f251933ac1
|
||||
"github.com/ewhal/nyaa/util/metainfo"
|
||||
"github.com/zeebo/bencode"
|
||||
)
|
||||
|
@ -148,10 +151,18 @@ func (r *TorrentRequest) ValidateMultipartUpload(req *http.Request) (int64, erro
|
|||
if torrent.IsPrivate() {
|
||||
return 0, errors.New("private torrents not allowed"), http.StatusBadRequest
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
trackers := torrent.GetAllAnnounceURLS()
|
||||
if !uploadService.CheckTrackers(trackers) {
|
||||
return 0, errors.New("tracker(s) not allowed"), http.StatusBadRequest
|
||||
}
|
||||
=======
|
||||
//import cycle
|
||||
/*trackers := torrent.GetAllAnnounceURLS()
|
||||
if !router.CheckTrackers(trackers) {
|
||||
return 0, errors.New("tracker(s) not allowed"), http.StatusBadRequest
|
||||
}*/
|
||||
>>>>>>> 5a32c00f503906080d518ceea69897f251933ac1
|
||||
|
||||
if r.Name == "" {
|
||||
r.Name = torrent.TorrentName()
|
||||
|
|
BIN
test.torrent
Fichier normal
BIN
test.torrent
Fichier normal
Fichier binaire non affiché.
Référencer dans un nouveau ticket