mafintosh / torrent-stream

The low level streaming torrent engine that peerflix uses
MIT License
1.94k stars 228 forks source link

Read partial pieces from storage #39

Closed BastienClement closed 10 years ago

BastienClement commented 10 years ago

This one seems to work. I can't see why it wouldn't. But careful reviewing of it would comfort me.

It would have been much cleaner with simply .filter().map(), but since object are just references, it would have destroyed the original piece-files map...

Also any stupid range (like [a-b] with a > b, or a == b) should be handled properly.

a defaults to 0 / b defaults to piecesLength.

BastienClement commented 10 years ago

Related to #37

asapach commented 10 years ago

I'm going to write some tests to cover this.

asapach commented 10 years ago

OK, here are the tests, asapach/torrent-stream@c7716be0a478317d3de104f8df9253fda4788c26 Looks fine, will see how it helps with #37

mafintosh commented 10 years ago

@asapach could you send me a PR with the tests as well?

mafintosh commented 10 years ago

@galedric cool stuff!

asapach commented 10 years ago

@mafintosh, on its way.

mafintosh commented 10 years ago

Released in 0.10.1