fix a bug in the add torrent via file in browsers other than FF
This commit is contained in:
parent
9b56fab8a1
commit
97a7890a28
@ -95,12 +95,14 @@ Ext.deluge.add.FileWindow = Ext.extend(Ext.deluge.add.Window, {
|
|||||||
|
|
||||||
onUploadSuccess: function(fp, upload) {
|
onUploadSuccess: function(fp, upload) {
|
||||||
this.hide();
|
this.hide();
|
||||||
var filename = upload.result.toString();
|
if (upload.result.success) {
|
||||||
this.form.getForm().findField('torrentFile').setValue('');
|
var filename = upload.result.files[0];
|
||||||
Deluge.Client.web.get_torrent_info(filename, {
|
this.form.getForm().findField('torrentFile').setValue('');
|
||||||
success: this.onGotInfo,
|
Deluge.Client.web.get_torrent_info(filename, {
|
||||||
scope: this,
|
success: this.onGotInfo,
|
||||||
filename: filename
|
scope: this,
|
||||||
});
|
filename: filename
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
File diff suppressed because one or more lines are too long
@ -156,9 +156,12 @@ class Upload(resource.Resource):
|
|||||||
os.write(fd, upload)
|
os.write(fd, upload)
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
filenames.append(fn)
|
filenames.append(fn)
|
||||||
request.setHeader("content-type", "text/plain")
|
request.setHeader("content-type", "text/html")
|
||||||
request.setResponseCode(http.OK)
|
request.setResponseCode(http.OK)
|
||||||
return "\n".join(filenames)
|
return common.json.dumps({
|
||||||
|
'success': True,
|
||||||
|
'files': filenames
|
||||||
|
})
|
||||||
|
|
||||||
class Render(resource.Resource):
|
class Render(resource.Resource):
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user