Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Remove folder when delete torrent and data #871

Open
DownloadHelper opened this issue Apr 27, 2020 · 5 comments
Open

Remove folder when delete torrent and data #871

DownloadHelper opened this issue Apr 27, 2020 · 5 comments

Comments

@DownloadHelper
Copy link

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
Copy link

artik commented May 10, 2020

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
Copy link
Author

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
Copy link

artik commented May 14, 2020

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

@artik
Copy link

artik commented May 15, 2020

@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
Copy link

artik commented May 17, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants