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>2015-08-28 21:41:08 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-08-28 21:41:08 +0300
commit41a6b3f60b22fd1996e249507a5e2719e71e3d57 (patch)
tree5d9560bed2ff6cd366907b7768e1449c59c70f9b
parentc1b5867b6b837b70349bd99f1b6e60c570117742 (diff)
parent97172234633cd7d53b119cb1a37335f21a6ec962 (diff)
Merge pull request #410 from Stiveknx/master
Add torrent.path property and update README with new properties
-rw-r--r--README.md12
-rw-r--r--lib/torrent.js5
2 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index 10053f5..8df1429 100644
--- a/README.md
+++ b/README.md
@@ -333,6 +333,18 @@ the file has.
The attached [bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance.
+#### `torrent.received`
+
+Get total bytes received from peers (including invalid data)
+
+#### `torrent.downloaded`
+
+Get total bytes received from peers (excluding invalid data)
+
+#### `torrent.path`
+
+Get the torrent download location
+
#### `torrent.destroy()`
Alias for `client.remove(torrent)`.
diff --git a/lib/torrent.js b/lib/torrent.js
index c3a9cf4..c7c7521 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -99,6 +99,11 @@ Object.defineProperty(Torrent.prototype, 'timeRemaining', {
}
})
+// Torrent Path
+Object.defineProperty(Torrent.prototype, 'path', {
+ get: function () { return this._path; }
+})
+
// Bytes completed (excluding invalid data)
Object.defineProperty(Torrent.prototype, 'downloaded', {
get: function () {