mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
add basic download log json structure
This commit is contained in:
@@ -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))
|
||||
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user