Discover Sonarr episode downloads and keep live tracker updating
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user