Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add d.tracker_domain command from rtorrent-ps #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rel0aded
Copy link

@rel0aded rel0aded commented Sep 26, 2022

As the jesec/rtorrent docker image doesn't contain functionality needed to move files for security reasons, one of the few ways of sorting files when running with lots of torrents (10k+ in this case) is to set the download directory to be derived from the tracker.

I have lifted (with a few minor changes to match C++ styling) the code from https://github.com/pyroscope/rtorrent-ps/blob/e5d95e1acd2698175540ae9d9dde3b33c96be9ea/patches/command_pyroscope.cc#L180, to add the d.tracker_domain command into the codebase, to allow downloads to go directly to their final sorted path.

This can be controlled by adding this to the rtorrent.rc file (where cfg.download is set to the base download directory), which is also responsible for creating the new directory if it doesn't exist, even without having mkdir inside the container (tested in a custom jesec/rtorrent container compiled with the proposed changes here):

method.insert = cfg.trackerdir, private|simple, "cat=(cfg.download), (d.tracker_domain)"
method.set_key = event.download.inserted_new, set_dest_dir, "fs.mkdir.recursive = (cfg.trackerdir); d.directory.set = (cfg.trackerdir)"

This change is similar to adding the rtorrent-ps strings.contains command proposed in this PR.

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

Successfully merging this pull request may close these issues.

1 participant