diff options
author | John Hiesey <john@hiesey.com> | 2021-02-10 00:57:21 +0300 |
---|---|---|
committer | John Hiesey <john@hiesey.com> | 2021-02-10 00:57:21 +0300 |
commit | c2a37c9efa07b840c791c27984729a789202a660 (patch) | |
tree | 3c613e74e6271b55cfab5e062ed3ef49936ce765 /index.js | |
parent | 17ac7fbb680206cc7467383b865811b7a485e9b3 (diff) |
Support opts.preloadedStore in webtorrent.seed
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |