mafintosh/torrent-stream — pull request #25 by ivantodorovich (2014-04-22 21:11:35+00:00)
Title: Refactor

I found the code to be a bit hard-to-read, hence hard to contribute. So I did my best to refactor TorrentStream to be closer to "the node.js way".

- Everything is contained on TorrentStream class now.
- Tried to comment as much as possible, to make code more understandable.
- I also added `read-torrent` support for loading torrents. Don't worry, it's even simplier than before.

API should be the same (the one documented), but changes made *might* break apps that tried to 'hack' into `torrent-stream`'s internals. (i don't know if there's any)

Tests throw a rather strange error, but they did even before I changed anything..

I tested it watching a movie on `peerflix`, and on my projects. No errors so far, the refactor was huge, though.. maybe I missed something.