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 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

Deselected mark Fix #316

  • Loading branch information
DiegoRBaquero committed Dec 15, 2015
commit 39b9475533efcf75a4904024d1efa70128220664
@@ -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)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.