flood icon indicating copy to clipboard operation
flood copied to clipboard

Remove folder when delete torrent and data

Open DownloadHelper opened this issue 4 years ago • 5 comments

Type: Feature Request

Summary

Currently, when we delete data from a torrent (which is a folder), only the files in that folder are deleted. This leaves empty folders.

Idea of implementation

Delete/rimraf the root folder (if exist) when 'delete data' checked.

DownloadHelper avatar Apr 27 '20 15:04 DownloadHelper

This comes from your rtorrent configuration file, not Flood. You should be able to perform what you want adding in your rtorrent.rc file:

# Delete feature
method.insert = d.data_path, simple, "if=(d.is_multi_file), (cat,(d.directory),/), (cat,(d.directory),/,(d.name))"
method.set_key = event.download.erased,delete_erased,"execute=rm,-rf,--,$d.data_path="

artik avatar May 10 '20 18:05 artik

This comes from your rtorrent configuration file, not Flood. You should be able to perform what you want adding in your rtorrent.rc file:

# Delete feature
method.insert = d.data_path, simple, "if=(d.is_multi_file), (cat,(d.directory),/), (cat,(d.directory),/,(d.name))"
method.set_key = event.download.erased,delete_erased,"execute=rm,-rf,--,$d.data_path="

Big thanks, it works. But why is there no simpler configuration for common functionality (in rtorrent) ?

DownloadHelper avatar May 14 '20 21:05 DownloadHelper

Haha, yeah, configuration is really powerful, but complex. Glad to hear it worked, you can close this issue :D

artik avatar May 14 '20 21:05 artik

@DownloadHelper Be carefull, this method ALSO delete files even if you uncheck "delete data" under Flood. If you find the solution, let us know :)

artik avatar May 15 '20 12:05 artik

I created a little docker container that monitor empty folders. Bind any local folder to /input and all empty folders will be removed every 60 seconds. This setting is a variable and can be changed.

artik avatar May 17 '20 17:05 artik