From 9981d0bc1976bb13b5e76492998f9ba56567f2c6 Mon Sep 17 00:00:00 2001 From: Jose Henrique Date: Wed, 8 Jul 2026 14:41:04 -0300 Subject: [PATCH] fix: use session-stats instead of session-get for stats --- main.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/main.go b/main.go index 373dca1..0c0ee3c 100644 --- a/main.go +++ b/main.go @@ -129,16 +129,9 @@ func (c *Client) Torrents(ctx context.Context) (json.RawMessage, error) { return resp.Args, nil } -// sessionFields requested for stats. -var sessionFields = []string{ - "downloadSpeed", "uploadSpeed", "torrentCount", "activeTorrentCount", - "pausedTorrentCount", "cumulativeDownloaded", "cumulativeUploaded", -} - func (c *Client) Stats(ctx context.Context) (json.RawMessage, error) { reqBody, _ := json.Marshal(rpcRequest{ - Method: "session-get", - Arguments: rpcArgs{Fields: sessionFields}, + Method: "session-stats", }) data, err := c.rpc(ctx, reqBody) if err != nil {