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
446 stars 137 forks source link

fileProgress(TorrentHandle.FileProgressFlags.PIECE_GRANULARITY) return zero size array if we call it after force recheck. #148

Closed mianharisali closed 7 years ago

mianharisali commented 7 years ago

This behaviour occurs of torrent is not completely downloaded. On seeding state it returns correct values.

aldenml commented 7 years ago

Yes, I see how that is possible, is a logic inside libtorrent, I will send a PR

aldenml commented 7 years ago

Fixed in 1.2.0.6-RC1

mianharisali commented 7 years ago

@aldenml now it returns correct size array , but the file progress return 0. this happens only if we force recheck it. even after force recheck it gives wrong values 0 for all files.

aldenml commented 7 years ago

PIECE_GRANULARITY only give you the pieces that have passed the hash check, since you are calling forceRecheck the internal progress cache is cleared, then this is the correct behavior. Now, this call to forceRecheck is asynchronous, so you need to work with the alerts to correctly time the call to fileProgress

mianharisali commented 7 years ago

@aldenml but even after force recheck the progress is 0 for all files.