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

actually upload the upload

Cette révision appartient à :
Andrew Zhao 2017-05-06 18:32:26 -07:00
Parent b922938c27
révision f9bb45b263
2 fichiers modifiés avec 6 ajouts et 5 suppressions

Voir le fichier

@ -89,9 +89,10 @@ func (f *UploadForm) ExtractInfo(r *http.Request) error {
}
// generate magnet
binInfoHash := torrent.Infohash()
f.Infohash = hex.EncodeToString(binInfoHash[:])
binInfohash := torrent.Infohash()
f.Infohash = hex.EncodeToString(binInfohash[:])
f.Magnet = util.InfoHashToMagnet(f.Infohash, f.Name)
f.Infohash = strings.ToUpper(f.Infohash)
} else {
magnetUrl, parseErr := url.Parse(f.Magnet)
if parseErr != nil {

Voir le fichier

@ -3,11 +3,11 @@
<div class="blockBody">
{{with .Upload}}
<hr>
<form role="upload" method="POST">
<form enctype="multipart/form-data" role="upload" method="POST">
<div class="form-group">
<label for="torrent">Torrent file upload</label>
<input type="file" id="torrent">
<input type="file" name="torrent" id="torrent" accept=".torrent">
<p class="help-block">Upload a torrent file to pre-fill information</p>
</div>
<div class="form-group">
@ -17,7 +17,7 @@
<div class="form-group">
<label for="Magnet">Magnet Link</label>
<input type="text" name="magnet" class="form-control"
style="width:60rem" placeholder="Magnet Link" value="{{.Magnet}}" required>
style="width:60rem" placeholder="Magnet Link" value="{{.Magnet}}">
</div>
<div class="form-group">
<label for="c">Category</label>