]> granicus.if.org Git - transmission/commitdiff
#4176 Add torrent by info hash
authorMitchell Livingston <livings124@transmissionbt.com>
Thu, 16 Jun 2011 02:19:39 +0000 (02:19 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Thu, 16 Jun 2011 02:19:39 +0000 (02:19 +0000)
web/javascript/transmission.remote.js

index b32575210bbae80ff6e45b70bbc12f9d50e0819b..37cb64ad798854fa4f6d019273257ba0e83dba2a 100644 (file)
@@ -249,6 +249,9 @@ TransmissionRemote.prototype =
        },
        addTorrentByUrl: function( url, options ) {
                var remote = this;
+        if(url.match(/^[0-9a-f]{40}$/i)) {
+            url = 'magnet:?xt=urn:btih:'+url;
+        }
                var o = {
                        method: 'torrent-add',
                        arguments: {