Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hiesey <john@hiesey.com>2021-02-10 00:57:21 +0300
committerJohn Hiesey <john@hiesey.com>2021-02-10 00:57:21 +0300
commitc2a37c9efa07b840c791c27984729a789202a660 (patch)
tree3c613e74e6271b55cfab5e062ed3ef49936ce765 /index.js
parent17ac7fbb680206cc7467383b865811b7a485e9b3 (diff)
Support opts.preloadedStore in webtorrent.seed
Diffstat (limited to 'index.js')
-rw-r--r--index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/index.js b/index.js
index bdceef7..692fe27 100644
--- a/index.js
+++ b/index.js
@@ -273,8 +273,8 @@ class WebTorrent extends EventEmitter {
const onTorrent = torrent => {
const tasks = [
cb => {
- // when a filesystem path is specified, files are already in the FS store
- if (isFilePath) return cb()
+ // when a filesystem path is specified or the store is preloaded, files are already in the FS store
+ if (isFilePath || opts.preloadedStore) return cb()
torrent.load(streams, cb)
}
]
@@ -304,7 +304,7 @@ class WebTorrent extends EventEmitter {
else if (!Array.isArray(input)) input = [input]
parallel(input.map(item => cb => {
- if (isReadable(item)) {
+ if (!opts.preloadedStore && isReadable(item)) {
concat(item, (err, buf) => {
if (err) return cb(err)
buf.name = item.name