From 4e39d8ffb29d91f6ef0cb6cdd88e239ef4af42c1 Mon Sep 17 00:00:00 2001 From: Kasper Plougmann Date: Fri, 11 Jul 2025 16:22:02 +0200 Subject: [PATCH] Update fetch_torrents.py --- fetch_torrents.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch_torrents.py b/fetch_torrents.py index d1d7a00..f0350d2 100644 --- a/fetch_torrents.py +++ b/fetch_torrents.py @@ -162,12 +162,12 @@ def log_seed_ratios_via_http(rpc_url="http://localhost:9091/transmission/rpc", a # sort by uploadRatio, highest first torrents_sorted = sorted( torrents, - key=lambda t: t.get("uploadRatio") or 0, + key=lambda t: float(t["uploadRatio"] or 0.0), reverse=True, ) 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 def cleanup_old_versions():