Fix: SABnzbd status polling (#439)

This commit is contained in:
Alex
2026-01-13 16:29:12 +00:00
committed by GitHub
parent bd1ad3495c
commit fbc3dd2552
3 changed files with 28 additions and 14 deletions
@@ -251,16 +251,26 @@ class SABnzbdClient(DownloadClient):
complete=True,
file_path=storage,
)
else:
# Failed or other status
fail_message = slot.get("fail_message", status_text)
elif status_text == "FAILED":
fail_message = slot.get("fail_message", "Download failed")
return DownloadStatus(
progress=100,
state="error",
message=f"Download failed: {fail_message}",
message=fail_message,
complete=True,
file_path=None,
)
else:
# Post-processing states: Queued, QuickCheck, Verifying,
# Repairing, Fetching, Extracting, Moving, Running
# Keep polling - not yet complete
return DownloadStatus(
progress=100,
state="processing",
message=status_text.title(),
complete=False,
file_path=None,
)
# Not found
logger.warning(f"SABnzbd: download {download_id} not found in queue or history")
@@ -202,7 +202,11 @@ class ProwlarrHandler(DownloadHandler):
# Build status message - use client message if provided, else build progress
msg = status.message or self._build_progress_message(status)
status_callback("downloading", msg)
if status.state == DownloadState.PROCESSING:
# Post-processing (e.g., SABnzbd verifying/extracting)
status_callback("resolving", msg)
else:
status_callback("downloading", msg)
# Wait for next poll (interruptible by cancel)
if cancel_flag.wait(timeout=POLL_INTERVAL):
@@ -396,8 +396,8 @@ def prowlarr_clients_settings():
key="QBITTORRENT_CATEGORY",
label="Book Category",
description="Category to assign to book downloads in qBittorrent",
placeholder="cwabd",
default="cwabd",
placeholder="books",
default="books",
show_when={"field": "PROWLARR_TORRENT_CLIENT", "value": "qbittorrent"},
),
TextField(
@@ -441,8 +441,8 @@ def prowlarr_clients_settings():
key="TRANSMISSION_CATEGORY",
label="Book Label",
description="Label to assign to book downloads in Transmission",
placeholder="cwabd",
default="cwabd",
placeholder="books",
default="books",
show_when={"field": "PROWLARR_TORRENT_CLIENT", "value": "transmission"},
),
TextField(
@@ -495,8 +495,8 @@ def prowlarr_clients_settings():
key="DELUGE_CATEGORY",
label="Book Label",
description="Label to assign to book downloads in Deluge",
placeholder="cwabd",
default="cwabd",
placeholder="books",
default="books",
show_when={"field": "PROWLARR_TORRENT_CLIENT", "value": "deluge"},
),
TextField(
@@ -601,8 +601,8 @@ def prowlarr_clients_settings():
key="SABNZBD_CATEGORY",
label="Book Category",
description="Category to assign to book downloads in SABnzbd",
placeholder="cwabd",
default="cwabd",
placeholder="books",
default="books",
show_when={"field": "PROWLARR_USENET_CLIENT", "value": "sabnzbd"},
),
TextField(
@@ -617,7 +617,7 @@ def prowlarr_clients_settings():
# Note: Usenet client download path must be mounted identically in both containers.
SelectField(
key="PROWLARR_USENET_ACTION",
label="Completion Action",
label="NZB Completion Action",
description="What to do with usenet files after download completes",
options=[
{"value": "move", "label": "Move to ingest"},