diff --git a/core/utils/general/logs.py b/core/utils/general/logs.py new file mode 100644 index 0000000..19b16da --- /dev/null +++ b/core/utils/general/logs.py @@ -0,0 +1,16 @@ +from core.utils.data.models import Download, DownloadList +import json + + + + +def add_download_log(title, url, magnet_uri, completed) -> DownloadList: + downloads: list[Download] = [] + downloads.append(Download( + title=title, + url=url, + magnet_uri=magnet_uri, + completed=completed + )) + + return DownloadList(data=downloads, count=len(downloads)) \ No newline at end of file diff --git a/core/utils/network/download.py b/core/utils/network/download.py index dbf7ef5..9332b2a 100644 --- a/core/utils/network/download.py +++ b/core/utils/network/download.py @@ -12,7 +12,6 @@ def download_selected(item, posts, post_titles): if state.debug: print(f"Downloading {item.text()}") run_thread(threading.Thread(target=run_download, args=(item.text(), posts, post_titles))) - else: if state.debug: print("No item selected for download.")