When options object is passing by arguments like var engine = torrentStream(link, options);, the options object is mutated and the path value will be the same for others execution.
For example:
var engine = torrentStream(link, options);engine = torrentStream(otherLink, options);
Then when the torrent is downloading the directory name (with hash) is the same for all file.
Posible soluction:
Copy the object options into the function torrentStream insted of mutate the object.
When options object is passing by arguments like
var engine = torrentStream(link, options);
, the options object is mutated and the path value will be the same for others execution.For example:
var engine = torrentStream(link, options);
engine = torrentStream(otherLink, options);
Then when the torrent is downloading the directory name (with hash) is the same for all file.
Posible soluction:
torrentStream
insted of mutate the object.