.then(() => rej(new Error('Cannot import torrent ' + torrentId + ': there are multiple files in it')))
}
- logger.debug('Got torrent from webtorrent %s.', id, { infoHash: torrent.infoHash, files: torrent.files })
+ logger.debug('Got torrent from webtorrent %s.', id, { infoHash: torrent.infoHash })
file = torrent.files[0]
pipeline(
file.createReadStream(),
writeStream,
- err => rej(err)
+ err => {
+ if (err) rej(err)
+ }
)
})