Discover Sonarr episode downloads and keep live tracker updating
Magent CI/CD / verify (push) Canceled after 1m9s
Magent CI/CD / deploy-prod (push) Canceled after 0s
Magent CI/CD / deploy-beta (push) Canceled after 0s

This commit is contained in:
2026-09-06 22:46:01 +12:00
parent bd668715a3
commit 625f9ad7f0
7 changed files with 157 additions and 10 deletions
+3 -1
View File
@@ -31,6 +31,7 @@ from ..db import (
from ..models import ActionOption, NormalizedState, RequestType, Snapshot, TimelineHop
from .collector_search import read_search_status
from .media_repair import current_cycle_torrents, evaluate_media_repair
from .download_labels import label_episode_downloads
logger = logging.getLogger(__name__)
@@ -1431,12 +1432,13 @@ async def build_snapshot(request_id: str) -> Snapshot:
try:
if qbittorrent.configured():
if download_ids:
torrents = await qbittorrent.get_torrents_by_hashes("|".join(download_ids))
torrents = await qbittorrent.get_torrents_by_hashes("|".join(h.lower() for h in download_ids))
torrent_list = torrents if isinstance(torrents, list) else []
else:
request_tag = f"magent-{request_id}"
torrents = await qbittorrent.get_torrents_by_tag(request_tag)
torrent_list = torrents if isinstance(torrents, list) else []
label_episode_downloads(torrent_list, arr_queue)
unfiltered_torrents = torrent_list
torrent_list = current_cycle_torrents(torrent_list, repair_cycle)
discarded_hashes = {str(t.get("hash") or "").lower() for t in unfiltered_torrents if t not in torrent_list}