add basic download log json structure

This commit is contained in:
Vxrtrauter
2026-01-07 22:41:11 +01:00
parent 56e8fada4d
commit ad6fa428a0
2 changed files with 16 additions and 1 deletions
+16
View File
@@ -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))
-1
View File
@@ -12,7 +12,6 @@ def download_selected(item, posts, post_titles):
if state.debug: if state.debug:
print(f"Downloading {item.text()}") print(f"Downloading {item.text()}")
run_thread(threading.Thread(target=run_download, args=(item.text(), posts, post_titles))) run_thread(threading.Thread(target=run_download, args=(item.text(), posts, post_titles)))
else: else:
if state.debug: if state.debug:
print("No item selected for download.") print("No item selected for download.")