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:
authorFeross Aboukhadijeh <feross@feross.org>2021-01-27 01:01:36 +0300
committerFeross Aboukhadijeh <feross@feross.org>2021-01-27 01:01:36 +0300
commitc1e352a7aedc9b13a454884550f52410dffd6a55 (patch)
tree4cb5981a5d268fc4d925833eb71a187effc765c4 /index.js
parenta6f287104d4198479d74e7c27695c9fc7b744c93 (diff)
seed: don't lose stream.name property
Diffstat (limited to 'index.js')
-rw-r--r--index.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/index.js b/index.js
index 13d62eb..bdceef7 100644
--- a/index.js
+++ b/index.js
@@ -304,8 +304,15 @@ class WebTorrent extends EventEmitter {
else if (!Array.isArray(input)) input = [input]
parallel(input.map(item => cb => {
- if (isReadable(item)) concat(item, cb)
- else cb(null, item)
+ if (isReadable(item)) {
+ concat(item, (err, buf) => {
+ if (err) return cb(err)
+ buf.name = item.name
+ cb(null, buf)
+ })
+ } else {
+ cb(null, item)
+ }
}), (err, input) => {
if (this.destroyed) return
if (err) return torrent._destroy(err)