Update fetch_torrents.py

This commit is contained in:
Kasper Plougmann 2025-07-11 16:22:02 +02:00 committed by GitHub
parent afb9ccc934
commit 4e39d8ffb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -162,12 +162,12 @@ def log_seed_ratios_via_http(rpc_url="http://localhost:9091/transmission/rpc", a
# sort by uploadRatio, highest first # sort by uploadRatio, highest first
torrents_sorted = sorted( torrents_sorted = sorted(
torrents, torrents,
key=lambda t: t.get("uploadRatio") or 0, key=lambda t: float(t["uploadRatio"] or 0.0),
reverse=True, reverse=True,
) )
for t in torrents_sorted: for t in torrents_sorted:
logging.info("[ratio] %s %.3f", t["name"], t["uploadRatio"]) logging.info("[ratio] %-50s %.3f", t["name"], float(t["uploadRatio"] or 0.0))
# Example: find all torrents for a distro, keep only the latest # Example: find all torrents for a distro, keep only the latest
def cleanup_old_versions(): def cleanup_old_versions():