fix: show only live torrent transfers
This commit is contained in:
@@ -1158,8 +1158,8 @@ async def test_qbittorrent_totals_counts_all_torrents():
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_qbittorrent_active_filters_dl_ul_only():
|
||||
"""Active kind returns all active download/upload states, including queued work."""
|
||||
async def test_qbittorrent_active_filters_current_transfers_only():
|
||||
"""Active kind returns only torrents with current download or upload throughput."""
|
||||
from media_library_viewer_api.widgets.sources import QbittorrentWidgetSource
|
||||
|
||||
adapter = QbittorrentWidgetSource()
|
||||
@@ -1175,15 +1175,10 @@ async def test_qbittorrent_active_filters_dl_ul_only():
|
||||
result = await adapter.fetch(service, "active", {})
|
||||
|
||||
active = result["torrents"]
|
||||
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
|
||||
assert "Queued" in names
|
||||
# Paused torrents remain excluded, but queued transfer work is visible.
|
||||
assert "Paused" not in names
|
||||
assert len(active) == 2
|
||||
names = [torrent["name"] for torrent in active]
|
||||
assert names == ["Movie.mkv", "Show.mkv"]
|
||||
assert all((torrent["dl_speed"] or 0) > 0 or (torrent["up_speed"] or 0) > 0 for torrent in active)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user