diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-04-23 17:14:51 +0400 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-04-23 17:14:51 +0400 |
commit | f1a5eabb8d5f8f15b9c2969e4cba0401fb136663 (patch) | |
tree | 2736b260dba1c2b05bab3aea8c71defcaf142c02 /bin | |
parent | bf61a54bd87c691d6e476147b5c7d86e8868a3f6 (diff) |
new constructor usage
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cmd.js | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -75,14 +75,15 @@ if (subtitles) { MPLAYER_EXEC += ' -sub ' + subtitles } -var manager = new WebTorrent(torrentId, { - +var client = new WebTorrent({ + list: list }) +client.add(torrentId) if (list) { // TODO - manager.on('ready', function () { - manager.files.forEach(function (file, i, files) { + client.on('torrent', function (torrent) { + torrent.files.forEach(function (file, i) { console.log(i, file.name) }) process.exit(0) |