From 6efeee8ca9917a9f0ab390273fc05516ec85d03b Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Fri, 25 Oct 2024 13:03:48 -0500 Subject: [PATCH] Sort by descending seed ratio --- list_torrents.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/list_torrents.py b/list_torrents.py index 88b4ff4..63fcf2b 100755 --- a/list_torrents.py +++ b/list_torrents.py @@ -48,7 +48,7 @@ def print_table(): qb.login() table = [] headers = ["Name", "Total Size", "Trackers Count", "Ratio", "Uploaded"] - sorted_torrents = sorted(qb.torrents(), key=lambda d: d["name"]) # type: ignore + sorted_torrents = sorted(qb.torrents(), key=lambda d: d["ratio"], reverse=True) # type: ignore for torrent in sorted_torrents: row = [] row.append(torrent["name"]) # type: ignore @@ -64,7 +64,7 @@ def print_table(): def print_ssv(): qb = Client("http://localhost:8080/") qb.login() - sorted_torrents = sorted(qb.torrents(), key=lambda d: d["name"]) # type: ignore + sorted_torrents = sorted(qb.torrents(), key=lambda d: d["ratio"], reverse=True) # type: ignore print("Name Size Trackers Ratio Uploaded") for torrent in sorted_torrents: name = torrent["name"] # type: ignore