mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
fixed notifications (kinda)
This commit is contained in:
@@ -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:
|
||||
notification.notify(
|
||||
title="Download finished",
|
||||
message=d.name,
|
||||
timeout=4)
|
||||
if dlprogress() == 100:
|
||||
notification.notify(
|
||||
title="Download finished",
|
||||
message=f"{d.name} has finished downloading.",
|
||||
timeout=4
|
||||
)
|
||||
except Exception as e:
|
||||
if state.debug:
|
||||
print("Notification thread error:", e)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user