feat(qbittorrent): show share ratio for active torrents
This commit is contained in:
@@ -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"),
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user