fixed notifications (kinda)

This commit is contained in:
2025-10-11 15:31:31 +02:00
parent b5d944278b
commit e4c50e20df
3 changed files with 8 additions and 11 deletions
+4 -7
View File
@@ -50,17 +50,14 @@ def dlprogress():
def send_notification():
while True:
if state.aria2 is None:
time.sleep(1)
continue
try:
for d in state.aria2.get_downloads():
if d.is_complete:
if dlprogress() == 100:
notification.notify(
title="Download finished",
message=d.name,
timeout=4)
message=f"{d.name} has finished downloading.",
timeout=4
)
except Exception as e:
if state.debug:
print("Notification thread error:", e)
+1 -1
View File
@@ -13,7 +13,7 @@ def get_item_url(item, posts, post_titles): # oftwarelist currentitem, post list
return item
if state.tracker == "rutracker":
item_dict = posts[post_index]
_, post_links = format_data([item_dict])
_, post_links, _ = format_data([item_dict])
return post_links[0]
return None
+1 -1
View File
@@ -49,7 +49,7 @@ if __name__ == "__main__":
state.aria2process = run_aria2server()
signal.signal(signal.SIGINT, keyboardinterrupthandler)
atexit.register(kill_aria2server)
# run_thread(threading.Thread(target=send_notification))
run_thread(threading.Thread(target=send_notification))
if state.debug:
print("Launching GUI")
run_gui()