Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign uptorrent.files[i].done is always false, even if file is fully downloaded #829
Comments
This comment has been minimized.
This comment has been minimized.
|
Sounds like it's probably a bug in your code. Are you checking the value of |
This comment has been minimized.
This comment has been minimized.
|
The file is done for sure. I'm checking for file.done in the client.add callback (reopen the app with a torrent/file that has been downloaded in a previous session). I'm also in an Electron renderer, if that matters. Here is a quick test code: client.add magnetURL, (torrent) ->
file = torrent.files[0]
console.log 'PRE-TEST'
console.log file.done
console.log file
console.log file.done
console.log 'POST-TEST'And here is what I get in the Console: Update |
This comment has been minimized.
This comment has been minimized.
|
The file won't be done immediately when the onTorrent callback is called. You can listen for the client.add(magnet, function (torrent) {
var file = torrent.files[0]
file.on('done', function () {
file.done // true
})
})You're seeing that it's true when you expand the object in the inspector because the developer tools just save a reference to the object and don't resolve the values of it's properties until you expand the object. If you hover over the 'i' icon in the interface you'll see: |
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |

However, if I
console.log(torrent.files[i]), I seedone: true.Any idea?