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:
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