frostwire / frostwire-jlibtorrent

A swig Java interface for libtorrent by the makers of FrostWire. Develop libtorrent based apps with the joy of coding in Java.
http://www.frostwire.com
MIT License
451 stars 138 forks source link

Download file size is large than real size #114

Closed alicemmm closed 7 years ago

alicemmm commented 7 years ago

I want to know the real file size and downloading file size. for example: downloadSize = torrentHandle.status().totalWantedDone(); but It's update so slowly.

How can I get the real file downloaded size not total downloaded size?

aldenml commented 7 years ago

There is a TorrentHandle#status(boolean force) to force the update. For the real file size, you have the torrent info, and for the real file downloaded size, take a look at TorrentHandle#getFileProgress

alicemmm commented 7 years ago

Thanks a lot !,I get the real torrent file size via TorrentHandle#getFileProgress,but if pause then resume TorrentHandle#getFileProgress get a smaller size than before

aldenml commented 7 years ago

strange, I will take a look at it

aldenml commented 7 years ago

Did you tested using FileProgressFlags#PIECE_GRANULARITY?

aldenml commented 7 years ago

Closing this, too old, open if necessary with more information.