omaralvarez / deluge-autoremoveplus

Auto removing of deluge torrents
152 stars 61 forks source link

Data not removed with torrent #5

Open tylerjl opened 9 years ago

tylerjl commented 9 years ago

Hey, thanks for the great plugin, your work is greatly appreciated.

I've been experiencing some odd issues where torrents are removed correctly, but the data persists on disk after torrent removal. It seems that others may be experiencing this as well.

My specs:

deluged --version
deluged: 1.3.11
libtorrent: 1.0.6.0

I've confirmed the user the deluged daemon is running under has permissions to remove the torrent data (nothing in the logs either.) It's also worth noting that I do use the Label plugin to move completed downloads to another location, which might be affecting this? If so, it'd still be nice to peg the exact problem so we might be able to detect and handle that case. I'm happy to provide any more details or try and code up a PR with a solution if you have a spot in the code to start looking at.

omaralvarez commented 9 years ago

Yes, I have heard about this issue in the forums. The thing is, that the code that removes a torrent and its data is a single API call is (core.py:264):

torrentmanager.remove(id, remove_data = remove_data)

This line is really simple, and if the torrent is getting removed, I'm inclined to think that this is a Deluge bug. What you are mentioning I think may be related, you could test the remove torrent with data option and see if that works, since it is virtually the same as the line of code. If Label is not the root cause, my money is on a deluge API bug. Please let me know what you find out, when I start working on new features, I'll take a look at this issue too.

cron410 commented 9 years ago

If you have used anything to extract the files in archives or rename the files, deluge will not delete those files and of course leave the parent folder. A workaround for win8.1 and server 2012r2 is to place a .bat (on windows) in the Deluge program files folder. Use the Execute plugin with "Torrent Removed" event type to run this batch file.

@echo off
set torrentid=%1
set torrentname=%2
set torrentpath=%3
@echo Torrent Deleted: %torrentpath%\%torrentname% %torrentid%  >> %appdata%\deluge\execute_script.log
remdir /s /q %torrentpath%\%torrentname%

This will delete the contents of the torrent whether you remove the torrent only, or remove torrent with data. Kinda breaks Deluge in a way, but it ensures you are deleting torrents completely.

ghost commented 9 years ago

I'm using move after complete and it works fine for me!

omaralvarez commented 9 years ago

@raspdealer What OS and deluge version? Do you also use the label plugin to move the downloads like @tylerjl?

ghost commented 9 years ago

Deluge: 1.3.12 OS: Raspbian And yes, I've set-up a MoveOnComplete for each labels.