From 3977da4291e6e771a7dbc14700f690fcddb85034 Mon Sep 17 00:00:00 2001 From: DasPoschi Date: Wed, 31 Dec 2025 10:15:36 +0100 Subject: [PATCH] Update app.py --- jd-webgui/app.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/jd-webgui/app.py b/jd-webgui/app.py index 974363f..c54c476 100644 --- a/jd-webgui/app.py +++ b/jd-webgui/app.py @@ -153,9 +153,19 @@ def get_device(): jd.connect(MYJD_EMAIL, MYJD_PASSWORD) jd.update_devices() - devices = getattr(jd, "devices", None) or [] - if not devices: - raise RuntimeError("No MyJDownloader devices available (is JDownloader online/logged in?)") + devices = getattr(jd, "devices", None) + if devices is None: + raise RuntimeError("MyJDownloader API returned no device list") + +if not devices: + # Devices exist laut Server, aber noch nicht synchron + time.sleep(2) + jd.update_devices() + devices = getattr(jd, "devices", []) or [] + +if not devices: + raise RuntimeError("MyJDownloader connected but no devices visible yet") + wanted = (MYJD_DEVICE or "").strip() if wanted: