mirror of
https://github.com/Laborratte5/linux-iso-seeder.git
synced 2025-12-30 17:08:17 +01:00
Sorted log of ratio
This commit is contained in:
parent
7796b5f6f7
commit
ec3eb9722a
1 changed files with 11 additions and 1 deletions
|
|
@ -156,7 +156,17 @@ def log_seed_ratios_via_http(rpc_url="http://localhost:9091/transmission/rpc", a
|
|||
}
|
||||
r = requests.post(rpc_url, json=payload, headers=headers, auth=auth, timeout=15)
|
||||
r.raise_for_status()
|
||||
for t in r.json()["arguments"]["torrents"]:
|
||||
|
||||
torrents = r.json()["arguments"]["torrents"]
|
||||
|
||||
# sort by uploadRatio, highest first
|
||||
torrents_sorted = sorted(
|
||||
torrents,
|
||||
key=lambda t: t.get("uploadRatio") or 0,
|
||||
reverse=True,
|
||||
)
|
||||
|
||||
for t in torrents_sorted:
|
||||
logging.info("[ratio] %s → %.3f", t["name"], t["uploadRatio"])
|
||||
|
||||
# Example: find all torrents for a distro, keep only the latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue