Skip to content

How is rtcontrol aware of fields? #66

Closed Answered by kannibalox
Rouneq asked this question in Q&A
Discussion options

You must be logged in to vote

This is a simple config.py that would get you what you're looking for:

from pyrosimple.torrent import engine
import pyrosimple


def _custom_fields():
    from pyrosimple.torrent import engine
    from pyrosimple.util import fmt, matching
    import functools

    # Add rTorrent attributes not available by default                                                                                  
    def get_tracker_field(obj, name, aggregator=sum):
        "Get an aggregated tracker field."
        return aggregator(obj.rpc_call("t.multicall", ["", f"t.{name}="])[0])

    yield engine.DynamicField(
        int,
        "downloaders",
        "number of completed downloads",
        matcher=m…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Rouneq
Comment options

@kannibalox
Comment options

Answer selected by Rouneq
@Rouneq
Comment options

@kannibalox
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants