Flood-UI / flood

A web UI for rTorrent, qBittorrent and Transmission with a Node.js backend and React frontend. Migrate to v4: https://github.com/jesec/flood/wiki/Migrate-from-older-versions-of-Flood.
https://flood.js.org
GNU General Public License v3.0
1.81k stars 173 forks source link

Remove folder when delete torrent and data #871

Open DownloadHelper opened 4 years ago

DownloadHelper commented 4 years ago

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.

artik commented 4 years ago

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="
DownloadHelper commented 4 years ago

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) ?

artik commented 4 years ago

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

artik commented 4 years ago

@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 commented 4 years ago

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.