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

new TorrentInfo(File) creates a false creationDate #134

Closed dessalines closed 7 years ago

dessalines commented 7 years ago

I've noticed that when using new TorrentInfo(File), it creates a bad creationDate, set to the current timestamp. I've notice that on a lot of torrents, creationDates are 0 (I think denoting optional).

Using either TorrentInfo.bdecode or Entry.bdecode provide the right results.

aldenml commented 7 years ago

I will take a look at it

aldenml commented 7 years ago

What version of jlibtorrent are you using?

dessalines commented 7 years ago

1.2.0.4 . It looks like creationDates are an optional field, and I've found that jlibtorrent will either set the creationDate to the current unix date, or to 0.

aldenml commented 7 years ago

I believe I found the reason for this inside libtorrent, the queue of PRs is no small, so it will take some time

aldenml commented 7 years ago

actually, looking at it again, everything seems to be correct, but I see that if the torrent is downloaded via magnet, it sets the time to the current date. Can you confirm that this is indeed your situation? If this is the case, I consider the behavior correct, since the torrent created with a magnet can't be expected to be equals to the original torrent.

dessalines commented 7 years ago

Yes I can, if its a magnet, it does set it to the current date.

aldenml commented 7 years ago

then, I will close the issue, because as I explained above, torrents fetched from the DHT are new torrents every time