diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-05-29 22:59:55 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-05-29 22:59:55 +0300 |
commit | 8dfcea0e818dc072202ffef93731e74e16128c8b (patch) | |
tree | 83733afe6c8f6f136b923c3a64922eeda5e511b6 /index.js | |
parent | 07f0685cbf3ec8a4ddcb9ebac7b8f4343d6787e8 (diff) |
moved remote torrent handling into parse-torrent@5.1
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -121,11 +121,12 @@ Object.defineProperty(WebTorrent.prototype, 'ratio', { * searching through the `client.torrents` array. Returns `null` if no matching torrent * found. * - * @param {string|Buffer|Object} torrentId + * @param {string|Buffer|Object|Torrent} torrentId * @return {Torrent|null} */ WebTorrent.prototype.get = function (torrentId) { var self = this + if (torrentId instanceof Torrent) return torrentId var parsed = parseTorrent(torrentId) if (!parsed.infoHash) throw new Error('Invalid torrent identifier') for (var i = 0, len = self.torrents.length; i < len; i++) { @@ -260,7 +261,7 @@ WebTorrent.prototype.destroy = function (cb) { var tasks = self.torrents.map(function (torrent) { return function (cb) { - self.remove(torrent.infoHash, cb) + self.remove(torrent, cb) } }) |