webtorrent/parse-torrent

Redundancy - Unify functions

DiegoRBaquero opened this issue · 1 comments

Currently, parse-torrent.remote tries to parse it as non-remote before trying to fetch from remote source index.js#L50-L60.

On WebTorrent it happens too torrent.js#L190-L207

I think parse-torrent should expose one function only (the remote one) as the main and only function.

I also don't understand why this exists if it will be assigned here

The reason that both exist is that sometime you want to parse a torrent synchronously. It's the same reason that fs.readFile and fs.readFileSync exist in Node.js.

Sorry, I wasn't able to see your code links because the codebase has since changed. Hint: Next time, hit the "y" key after selecting the lines you want to link to, and you will get a permalink.