Created
November 10, 2012 00:45
-
-
Save pwmckenna/4049280 to your computer and use it in GitHub Desktop.
torque add torrent callback possibilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = app.btapp.get('torrent').download({ | |
url: 'magnet:?xt=urn:btih:D075D45EA1DA3E20BA148A08D984EFFC439273A4', | |
callback: function() { | |
// torrent has been added to the torrent list of the client. | |
// this is called immediately on magnet links, | |
// but might take a bit for http://*.torrent file urls | |
} | |
}); | |
request.then(function(res) { | |
// the client has heard and acknowledged your request | |
}, function(res) { | |
// awwww shit | |
}); | |
request.done(function(res) { | |
// I only care about success! | |
}); | |
request.fail(function(res) { | |
// I only care about failure! | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment