diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-06-06 08:50:56 +0400 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-06-06 08:50:56 +0400 |
commit | f11f2085bf0d75fffd70299d63b819a77ed51d03 (patch) | |
tree | 282f81ef8bde5c57eccfc3ce1a7173c6e439ca6a | |
parent | 34db97944cd5f5eff758e845fd2f102b8d929b13 (diff) |
document that parsed torrents are valid torrentId
-rw-r--r-- | index.js | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -47,14 +47,15 @@ function WebTorrent (opts) { /** * Add a new torrent to the client. `torrentId` can be one of: * - * - a magnet uri (utf8 string) - * - a torrent file (buffer) - * - an info hash (hex string or buffer) - * - an http/https url to a .torrent file (string) - * - a filesystem path to a .torrent file (string) + * - magnet uri (utf8 string) + * - torrent file (buffer) + * - info hash (hex string or buffer) + * - parsed torrent (from parse-torrent module) + * - http/https url to a .torrent file (string) + * - filesystem path to a .torrent file (string) * * @override - * @param {string|Buffer} torrentId torrent (choose from above list) + * @param {string|Buffer|Object} torrentId torrent (choose from above list) * @param {Object} opts optional torrent-specific options * @param {function=} cb called when the torrent is ready and has metadata */ @@ -85,7 +86,7 @@ WebTorrent.prototype.add = function (torrentId, opts, cb) { } if (Client.toInfoHash(torrentId)) { - // magnet uri, info hash, or torrent file can be handled by bittorrent-client + // magnet uri, info hash, torrent file, or parsed torrent can be handled by bittorrent-client process.nextTick(function () { onTorrentId(torrentId) }) |