Issue 58: empty files replace regular files w/ rtorrent
Status:  New
Owner: ----
Reported by fizze2...@gmail.com, Mar 6, 2012
What steps will reproduce the problem?
1. integrate with rtorrent as described in the wiki
2. enable destructive mode
3. after finishing the download, rtorrent will complain about "Hash check on download completion found bad chunks, consider using "safe_sync"."
4. after download completion, torrentexpander does its work and moves the file (destructively) to a different folder
5. rtorrent creates an empty file (0 bytes)
6. when the torrent is removed from rtorrent, torrentexpander is called again, overwriting the regular file with the empty one

What is the expected output? What do you see instead?
rtorrent shouldn't complain.
I specified this in my .rtorrent.rc:
system.method.set = group.seeding.ratio.command, d.close=, d.erase=
system.method.set_key = event.download.closed,torrentexpander,"execute=/home/user/torrentexpander.sh,$d.get_base_path=,$d.get_base_filename="
pieces.sync.always_safe.set = no

rtorrent is running as "user"

What version of the product are you using? On what operating system?
rtorrent 0.9.0 with libtorrent 0.13.0.
torrentexpander r172
rutorrent 3.4

Please provide any additional information below.
tv_shows_post=move
destructive_mode=yes
Mar 6, 2012
Project Member #1 addicted...@gmail.com
Hi
From what you describe, this looks like a rtorrent bug.
From what I'm reading, there's no way for torrentexpander to detect that a damaged torrent was sent by rtorrent.
We could be able to workaround this bug by not replacing a movie / series / audio file in post move or post copy mode if the new file is only 0k.
I'll look into this when I get more time (about two weeks from now).

Does the removal from rtorrent's downloads list work ? If it does, then I don't see why it recreates an empty file afterwards.

You should maybe look at the rtorrent forums because I don't see why rtorrent sends a damaged torrent to torrentexpander. Why it sends a 0k file afterwards is just plain weird.

Thanks
Mar 7, 2012
#2 fizze2...@gmail.com
That's the weird thing. Torrent removal works when I do not enable torrentexpander.
With torrentexpander command as event.download.closed it does not work.
This seems only to happen when destructive mode is on, though.

I'll try to use event.download.erased to call torrentexpander. Let's see how that goes.

Ignoring 0 byte files would be a workaround for this problem, agreed.
Mar 8, 2012
#3 fizze2...@gmail.com
Workaround confirmed!

Please include this info to the rtorrent wiki entry.
event.download.erased works like it is supposed to be in destructive mode when moving files.
Mar 22, 2012
Project Member #4 login...@gmail.com
give me some info about this command:
system.method.set = group.seeding.ratio.command, d.close=, d.erase=
i think this is the real problem. 

the command used in wiki:
system.method.set_key = event.download.closed
do not cause any error, it's safe.
Mar 23, 2012
#5 fizze2...@gmail.com
The command "system.method.set = group.seeding.ratio.command, d.close=, d.erase=" tells rtorrent that after the specified ratio has been reached for this group, that the it should stop seeding and remove the torrent file.

Dec 2, 2012
Project Member #6 addicted...@gmail.com
I need help here

What am I supposed to do there ? I'm not using rtorrent (nor any torrent software, for that matter) so I'll need help on that.

Thanks for your input

   Addictedtoscreens