feat(qbittorrent): show share ratio for active torrents

This commit is contained in:
Developer
2026-07-21 12:36:03 +00:00
parent 11f093cd2c
commit 0866dc4136
5 changed files with 17 additions and 1 deletions
@@ -547,6 +547,7 @@ class QbittorrentWidgetSource:
"direction": direction,
"size": torrent.get("size"),
"progress": torrent.get("progress"),
"ratio": torrent.get("ratio"),
"dl_speed": torrent.get("dlspeed"),
"up_speed": torrent.get("upspeed"),
}
+3
View File
@@ -1085,6 +1085,7 @@ def _fake_qbit_maindata():
"state": "downloading",
"size": 1000,
"progress": 0.5,
"ratio": 1.25,
"dlspeed": 500,
"upspeed": 10,
},
@@ -1093,6 +1094,7 @@ def _fake_qbit_maindata():
"state": "uploading",
"size": 2000,
"progress": 1.0,
"ratio": 0.5,
"dlspeed": 0,
"upspeed": 100,
},
@@ -1178,6 +1180,7 @@ async def test_qbittorrent_active_filters_current_transfers_only():
assert len(active) == 2
names = [torrent["name"] for torrent in active]
assert names == ["Movie.mkv", "Show.mkv"]
assert [torrent["ratio"] for torrent in active] == [1.25, 0.5]
assert all((torrent["dl_speed"] or 0) > 0 or (torrent["up_speed"] or 0) > 0 for torrent in active)