Skip to content

Commit

Permalink
Pull fix for example custom tracker field from pyrocore
Browse files Browse the repository at this point in the history
  • Loading branch information
kannibalox committed Oct 24, 2022
1 parent 9714371 commit dc712d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed
- Use all trackers when aggregating in example custom field code
(credit goes to @kchiem: https://github.com/pyroscope/pyrocore/pull/105)

## [2.2.1] - 2022-10-24

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/custom-fields-trackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def _custom_fields():
# 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])
return aggregator([t[0] for t in obj.rpc_call("t.multicall", ["", f"t.{name}="])])

yield engine.DynamicField(
int,
Expand Down

0 comments on commit dc712d2

Please sign in to comment.