fix: include all active torrent states
This commit is contained in:
@@ -1128,12 +1128,12 @@ async def test_qbittorrent_totals_counts_all_torrents():
|
||||
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}
|
||||
assert result["by_direction"] == {"downloading": 3, "uploading": 2}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_qbittorrent_active_filters_dl_ul_only():
|
||||
"""Active kind returns only downloading/uploading torrents (Q3)."""
|
||||
"""Active kind returns all active download/upload states, including queued work."""
|
||||
from media_library_viewer_api.widgets.sources import QbittorrentWidgetSource
|
||||
|
||||
adapter = QbittorrentWidgetSource()
|
||||
@@ -1149,14 +1149,14 @@ async def test_qbittorrent_active_filters_dl_ul_only():
|
||||
result = await adapter.fetch(service, "active", {})
|
||||
|
||||
active = result["torrents"]
|
||||
assert len(active) == 4
|
||||
assert len(active) == 5
|
||||
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 "Queued" in names
|
||||
# Paused torrents remain excluded, but queued transfer work is visible.
|
||||
assert "Paused" not in names
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user