Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix required torrent name on upload

Cette révision appartient à :
akuma06 2017-06-10 20:09:25 +02:00
Parent 0d36f59ca9
révision b68bd9ead4

Voir le fichier

@ -221,6 +221,10 @@ func (r *TorrentRequest) ExtractEditInfo(req *http.Request) error {
return err
}
err = r.validateName()
if err != nil {
return err
}
defer req.Body.Close()
err = r.ExtractCategory(req)
@ -288,12 +292,8 @@ func (r *TorrentRequest) ExtractBasicValue(req *http.Request) error {
r.Magnet = strings.TrimSpace(r.Magnet)
// then actually check that we have everything we need
err := r.validateName()
if err != nil {
return err
}
err = r.validateDescription()
err := r.validateDescription()
if err != nil {
return err
}
@ -328,6 +328,12 @@ func (r *TorrentRequest) ExtractInfo(req *http.Request) error {
return err
}
// We check name only here, reason: we can try to retrieve them from the torrent file
err = r.validateName()
if err != nil {
return err
}
// after data has been checked & extracted, write it to disk
if len(config.Conf.Torrents.FileStorage) > 0 {
err := writeTorrentToDisk(tfile, r.Infohash+".torrent", &r.Filepath)