Hide header actions when signed out

This commit is contained in:
2026-01-23 19:16:17 +13:00
parent 49e9ee771f
commit 24685a5371
4 changed files with 21 additions and 13 deletions

View File

@@ -465,9 +465,14 @@ async def build_snapshot(request_id: str) -> Snapshot:
try:
download_ids = _download_ids(_queue_records(arr_queue))
torrent_list: List[Dict[str, Any]] = []
if download_ids and qbittorrent.configured():
torrents = await qbittorrent.get_torrents_by_hashes("|".join(download_ids))
torrent_list = torrents if isinstance(torrents, list) else []
if qbittorrent.configured():
if download_ids:
torrents = await qbittorrent.get_torrents_by_hashes("|".join(download_ids))
torrent_list = torrents if isinstance(torrents, list) else []
else:
category = f"magent-{request_id}"
torrents = await qbittorrent.get_torrents_by_category(category)
torrent_list = torrents if isinstance(torrents, list) else []
summary = _summarize_qbit(torrent_list)
qbit_state = summary.get("state")
qbit_message = summary.get("message")