diff --git a/core/network/aria2_integration.py b/core/network/aria2_integration.py index 5669ca1..bfde2e3 100644 --- a/core/network/aria2_integration.py +++ b/core/network/aria2_integration.py @@ -49,10 +49,9 @@ def dlprogress(): return 0 def send_notification(): - while True: try: - for download in state.aria2: + for download in state.aria2.get_downloads(): if dlprogress() == 100: notification.notify( title = "Download finished", diff --git a/core/utils/data/state.py b/core/utils/data/state.py index cba4e03..f685d20 100644 --- a/core/utils/data/state.py +++ b/core/utils/data/state.py @@ -1,4 +1,4 @@ -from dataclasses import dataclass, field +from dataclasses import dataclass from typing import Optional, Any, List, Dict from pathlib import Path @@ -14,7 +14,7 @@ class AppState: download_path: str = str(Path.home() / "Downloads") speed_limit: int = 0 aria2process: Optional[Any] = None - aria2: list[Any] = field(default_factory=list) + aria2: Any = None aria2_threads: int = 4 state = AppState(posts=[], post_titles=[], post_urls=[], post_author=[], download_path="")