rndusr / torf-cli

CLI tool for creating, reading and editing torrent files
GNU General Public License v3.0
134 stars 13 forks source link

Editing sources creates new torrent #12

Closed AlanKellyEire closed 5 years ago

AlanKellyEire commented 5 years ago

If you edit the source and a tracker at the same time the resulting torrent will be NEW and not an edited version of the original.

Steps to reproduce 1). Create new torrent if you do not have an existing one to edit. torf somefile -t http://bar:123/announce -t http://baz:321/announce --private 2). add torrent to your torrent client 3). edit the torrent by changing the source and adding a new tracker torf -i somefile.torrent -t http://test:123/announce -s "test" -o new-somefile.torrent 4). add torrent to your torrent client

you will see that the edited torrent did not update the original torrent in your client and instead created a new torrent.

Torrent client tested with: transmission 2.94

rndusr commented 5 years ago

This is expected because changing the source changes the torrent's hash. If you change the torrent's comment, which doesn't change the hash, Transmission will refuse to add it again because it's already tracking a torrent with the same hash.

AFAIK, the whole point of the "source" field is to make the torrent unique to a tracker so users can cross-seed on multiple trackers, even if the torrents have the same content and piece size.

But this should definitely be documented in the man page, so I'll leave this open.

rndusr commented 5 years ago

I've documented the hash-changing behaviour in the man page.