fixer api thread error spam message for notification

This commit is contained in:
Vxrtrauter
2025-10-11 20:41:16 +02:00
parent a9450435d7
commit c151b87da9
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -49,10 +49,9 @@ def dlprogress():
return 0 return 0
def send_notification(): def send_notification():
while True: while True:
try: try:
for download in state.aria2: for download in state.aria2.get_downloads():
if dlprogress() == 100: if dlprogress() == 100:
notification.notify( notification.notify(
title = "Download finished", title = "Download finished",
+2 -2
View File
@@ -1,4 +1,4 @@
from dataclasses import dataclass, field from dataclasses import dataclass
from typing import Optional, Any, List, Dict from typing import Optional, Any, List, Dict
from pathlib import Path from pathlib import Path
@@ -14,7 +14,7 @@ class AppState:
download_path: str = str(Path.home() / "Downloads") download_path: str = str(Path.home() / "Downloads")
speed_limit: int = 0 speed_limit: int = 0
aria2process: Optional[Any] = None aria2process: Optional[Any] = None
aria2: list[Any] = field(default_factory=list) aria2: Any = None
aria2_threads: int = 4 aria2_threads: int = 4
state = AppState(posts=[], post_titles=[], post_urls=[], post_author=[], download_path="") state = AppState(posts=[], post_titles=[], post_urls=[], post_author=[], download_path="")