From 223dcd9a4c9ea424e7be08fe9c8c1f37c3b6ffc3 Mon Sep 17 00:00:00 2001 From: KeksNino Date: Fri, 10 Oct 2025 23:10:09 +0200 Subject: [PATCH] temporarily disable notifications because of bug --- core/network/aria2_integration.py | 21 ++++++++++++--------- main.py | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/core/network/aria2_integration.py b/core/network/aria2_integration.py index fa2b7da..627b011 100644 --- a/core/network/aria2_integration.py +++ b/core/network/aria2_integration.py @@ -50,15 +50,18 @@ def dlprogress(): def send_notification(): while True: + if state.aria2 is None: + time.sleep(1) + continue + try: - downloads = state.aria2.get_downloads() - if downloads: - for download in downloads: - if download.is_complete: - # notification.notify("Download Complete" - print("yet") - time.sleep(5) + for d in state.aria2.get_downloads(): + if d.is_complete: + notification.notify( + title="Download finished", + message=d.name, + timeout=4) except Exception as e: if state.debug: - print(f"Notification Error: {e}") - break + print("Notification thread error:", e) + time.sleep(5) diff --git a/main.py b/main.py index 66c171f..6066907 100644 --- a/main.py +++ b/main.py @@ -47,9 +47,9 @@ if __name__ == "__main__": if state.debug: print("Starting Aria2 Server") state.aria2process = run_aria2server() - run_thread(threading.Thread(target=send_notification)) signal.signal(signal.SIGINT, keyboardinterrupthandler) atexit.register(kill_aria2server) + # run_thread(threading.Thread(target=send_notification)) if state.debug: print("Launching GUI") run_gui()