mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
(web) fix add-by-URL regression in the nightlies
This commit is contained in:
parent
c51132ad78
commit
c3be9b9afc
1 changed files with 18 additions and 0 deletions
|
@ -952,6 +952,24 @@ Transmission.prototype =
|
|||
}
|
||||
reader.readAsDataURL (file);
|
||||
});
|
||||
|
||||
var url = $('#torrent_upload_url').val();
|
||||
if (url != '') {
|
||||
if (url.match(/^[0-9a-f]{40}$/i))
|
||||
url = 'magnet:?xt=urn:btih:'+url;
|
||||
var o = {
|
||||
'method': 'torrent-add',
|
||||
arguments: {
|
||||
'paused': paused,
|
||||
'download-dir': destination,
|
||||
'filename': url
|
||||
}
|
||||
};
|
||||
remote.sendRequest (o, function(response) {
|
||||
if (response.result != 'success')
|
||||
alert ('Error adding "' + file.name + '": ' + response.result);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue