Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to acess: client.ratio #463

Closed
Stiveknx opened this issue Oct 16, 2015 · 2 comments
Closed

Error trying to acess: client.ratio #463

Stiveknx opened this issue Oct 16, 2015 · 2 comments

Comments

@Stiveknx
Copy link
Contributor

@Stiveknx Stiveknx commented Oct 16, 2015

According to API, I can access a "global" ratio.

But when I try to access:

client.ratio

It fails with:
TypeError: Cannot read property 'length' of undefined at Torrent.Object.defineProperty.get (/home/webtorrentapp/node_modules/webtorrent-hybrid/node_modules/webtorrent/lib/torrent.js:106:42)

I tryied commenting this.pieces.length in line:
https://github.com/feross/webtorrent/blob/master/lib/torrent.js#L106

The error goes away.
Apparently is: I created a new torrent. The torrent is added in client.torrents, but no pieces were found / or downloaded yet. So when I call client.ratio, it calls all torrents and count his pieces, but no pieces were downloaded.

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Dec 11, 2015

Solved in 0.63.4 with efa410d

Not yet published in NPM as feross hasn't been around.

@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 5, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.