Skip to content

Commit

Permalink
add 'd.tracker_alias' command
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed Jun 16, 2018
1 parent c49b0b9 commit 1c08bda
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions docs/include-cmd-items.rst
Original file line number Diff line number Diff line change
Expand Up @@ -931,13 +931,23 @@ When called within configuration methods or in a ``Ctrl-X`` prompt, the target i
:term:`f.priority` for commands relating to file prioritization.


d.tracker_alias
d.tracker_domain

**rTorrent-PS only**
.. rubric:: *rTorrent-PS only*

Returns the (shortened) tracker domain of the given download item. The
chosen tracker is the first HTTP one with active peers (seeders or
leechers), or else the first one.
``d.tracker_domain`` returns a shortened version of the domain in the tracker's URL,
for a given download item.
The chosen tracker is the first HTTP one with active peers (seeders or leechers),
or else the first one.

``d.tracker_alias`` (1.1+ only) is basically the same,
but uses the mappings defined by :term:`trackers.alias.set_key` to transform its return value.
The main use-case for that is to be able to sort the `rTorrent-PS` ``trackers`` view
by the same values as shown to the very right of the terminal.

But you can also use it in a :term:`d.multicall.filtered` command together with :term:`string.equals`,
to easily select items of one or more specified tracker(s).

.. rubric:: Example

Expand All @@ -946,14 +956,15 @@ When called within configuration methods or in a ``Ctrl-X`` prompt, the target i
# Trackers view (all items, sorted by tracker domain and then name).
# This will ONLY work if you use rTorrent-PS!
view.add = trackers
view.sort_new = trackers, "compare=,d.tracker_domain=,d.name="
view.sort_current = trackers, "compare=,d.tracker_domain=,d.name="
view.sort_new = trackers, "compare=,d.tracker_alias=,d.name="
view.sort_current = trackers, "compare=,d.tracker_alias=,d.name="
d.tracker_scrape.complete
d.tracker_scrape.downloaded
d.tracker_scrape.incomplete

**rTorrent-PS 1.1+ only**
.. rubric:: *rTorrent-PS 1.1+ only*

**TODO**

Expand Down

0 comments on commit 1c08bda

Please sign in to comment.