Browse Source

Patch webtorrent files to mark selected files

master
David Ludwig 4 years ago
parent
commit
516f61b1f6
1 changed files with 26 additions and 0 deletions
  1. +26
    -0
      patches/webtorrent+0.116.0.patch

+ 26
- 0
patches/webtorrent+0.116.0.patch View File

@ -0,0 +1,26 @@
diff --git a/node_modules/webtorrent/lib/file.js b/node_modules/webtorrent/lib/file.js
index caa395d..80234de 100644
--- a/node_modules/webtorrent/lib/file.js
+++ b/node_modules/webtorrent/lib/file.js
@@ -21,6 +21,7 @@ class File extends EventEmitter {
this.length = file.length
this.offset = file.offset
+ this.isSelected = true
this.done = false
const start = file.offset
@@ -85,11 +86,13 @@ class File extends EventEmitter {
select (priority) {
if (this.length === 0) return
+ this.isSelected = true
this._torrent.select(this._startPiece, this._endPiece, priority)
}
deselect () {
if (this.length === 0) return
+ this.isSelected = false
this._torrent.deselect(this._startPiece, this._endPiece, false)
}

Loading…
Cancel
Save