Skip to content

Add d.tracker_domain command from rtorrent-ps#49

Open
rel0aded wants to merge 1 commit into
jesec:masterfrom
rel0aded:tracker_domain
Open

Add d.tracker_domain command from rtorrent-ps#49
rel0aded wants to merge 1 commit into
jesec:masterfrom
rel0aded:tracker_domain

Conversation

@rel0aded

@rel0aded rel0aded commented Sep 26, 2022

Copy link
Copy Markdown

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