mafintosh / torrent-stream

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

Detect download finished #78

Open MatiasSM opened 10 years ago

MatiasSM commented 10 years ago

I was wondering if there is any way of detecting when the torrent has been completely downloaded (no more pieces are expected).

That is considering the case we don't have the length specified in the torrent file (eg. because we are using a magnet link)

mafintosh commented 10 years ago

When the metadata has been fetched a torrent event is emitted. If all selected files have been completely downloaded an idle event is emitted. We should probably document both :)

MatiasSM commented 10 years ago

Thank you very much, just one remaining question: The idle event is emitted only when the files have been completely downloaded or it may be risen if the downloading stalls?

El día miércoles, 6 de agosto de 2014 3:43, Mathias Buus notifications@github.com escribió:

When the metadata has been fetched a torrent event is emitted. If all selected files have been completely downloaded an idle event is emitted. We should probably document both :) — Reply to this email directly or view it on GitHub.

mafintosh commented 9 years ago

It is only emitted when the selected files have been completely downloaded