fix: show active qBittorrent transfers
This commit is contained in:
@@ -1086,6 +1086,22 @@ def _fake_qbit_maindata():
|
||||
"dlspeed": 0,
|
||||
"upspeed": 0,
|
||||
},
|
||||
"h5": {
|
||||
"name": "Forced download",
|
||||
"state": "forcedDL",
|
||||
"size": 5000,
|
||||
"progress": 0.4,
|
||||
"dlspeed": 0,
|
||||
"upspeed": 0,
|
||||
},
|
||||
"h6": {
|
||||
"name": "Stalled upload",
|
||||
"state": "stalledUP",
|
||||
"size": 6000,
|
||||
"progress": 1.0,
|
||||
"dlspeed": 0,
|
||||
"upspeed": 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1107,11 +1123,12 @@ async def test_qbittorrent_totals_counts_all_torrents():
|
||||
mock_client.return_value.maindata.return_value = _fake_qbit_maindata()
|
||||
result = await adapter.fetch(service, "totals", {})
|
||||
|
||||
assert result["total"] == 4
|
||||
assert result["total"] == 6
|
||||
assert result["by_state"]["downloading"] == 1
|
||||
assert result["by_state"]["uploading"] == 1
|
||||
assert result["by_state"]["queuedDL"] == 1
|
||||
assert result["by_state"]["pausedDL"] == 1
|
||||
assert result["by_direction"] == {"downloading": 2, "uploading": 2}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -1132,10 +1149,12 @@ async def test_qbittorrent_active_filters_dl_ul_only():
|
||||
result = await adapter.fetch(service, "active", {})
|
||||
|
||||
active = result["torrents"]
|
||||
assert len(active) == 2
|
||||
assert len(active) == 4
|
||||
names = [t["name"] for t in active]
|
||||
assert "Movie.mkv" in names
|
||||
assert "Show.mkv" in names
|
||||
assert "Forced download" in names
|
||||
assert "Stalled upload" in names
|
||||
# Queued and paused are excluded
|
||||
assert "Queued" not in names
|
||||
assert "Paused" not in names
|
||||
|
||||
Reference in New Issue
Block a user