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

Deselected mark Fix #316 #528

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -26,6 +26,7 @@ function File (torrent, file) {
this.offset = file.offset

this.done = false
this.deselected = false

var start = file.offset
var end = start + file.length - 1
@@ -45,6 +46,7 @@ function File (torrent, file) {
*/
File.prototype.select = function () {
if (this.length === 0) return
this.deselected = false
this._torrent.select(this._startPiece, this._endPiece, false)
}

@@ -54,6 +56,7 @@ File.prototype.select = function () {
*/
File.prototype.deselect = function () {
if (this.length === 0) return
this.deselected = true
this._torrent.deselect(this._startPiece, this._endPiece, false)
}

@@ -1153,7 +1153,7 @@ Torrent.prototype._checkDone = function () {
})

// is the torrent done?
if (self.files.every(function (file) { return file.done })) {
if (self.files.every(function (file) { return file.done || file.deselected })) {
self.done = true
self.emit('done')
debug('torrent done: ' + self.infoHash)
@@ -1,7 +1,7 @@
{
"name": "webtorrent",
"description": "Streaming torrent client",
"version": "0.63.3",
"version": "0.63.4",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",

Large diffs are not rendered by default.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.