From 516f61b1f6117ffd9edf67e51d19b2d03bdfda07 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sat, 3 Apr 2021 22:27:40 -0500 Subject: [PATCH] Patch webtorrent files to mark selected files --- patches/webtorrent+0.116.0.patch | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patches/webtorrent+0.116.0.patch diff --git a/patches/webtorrent+0.116.0.patch b/patches/webtorrent+0.116.0.patch new file mode 100644 index 0000000..bcc1c67 --- /dev/null +++ b/patches/webtorrent+0.116.0.patch @@ -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) + } +