Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-06-06 08:50:56 +0400
committerFeross Aboukhadijeh <feross@feross.org>2014-06-06 08:50:56 +0400
commitf11f2085bf0d75fffd70299d63b819a77ed51d03 (patch)
tree282f81ef8bde5c57eccfc3ce1a7173c6e439ca6a
parent34db97944cd5f5eff758e845fd2f102b8d929b13 (diff)
document that parsed torrents are valid torrentId
-rw-r--r--index.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/index.js b/index.js
index fb87228..965be11 100644
--- a/index.js
+++ b/index.js
@@ -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)
})