Compare commits

...

3 Commits

Author SHA1 Message Date
Vxrtrauter 83ff2720c8 add error handling for magnet uri being none 2026-01-20 10:43:02 +01:00
Vxrtrauter 83adbb027f fix aria2 connection refused errors caused by autoresume 2026-01-19 13:49:20 +01:00
KeksNino 606c70efcc add unicode icons for pause/resume and fix action column size 2026-01-18 21:39:40 +01:00
4 changed files with 24 additions and 6 deletions
+3 -3
View File
@@ -199,7 +199,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
col = index.column()
if col == 0:
return "Resume" if download.is_paused else "Pause"
return "▶︎" if download.is_paused else "⏸︎"
elif col == 1:
return download.name
elif col == 2:
@@ -239,7 +239,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
button = QStyleOptionButton()
button.rect = option.rect
button.text = "Resume" if paused else "Pause"
button.text = "▶︎" if paused else "⏸︎"
button.state = QStyle.State_Enabled
QApplication.style().drawControl(
@@ -255,7 +255,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
self.download_model = DownloadModel()
self.downloadList.setModel(self.download_model)
self.downloadList.horizontalHeader().setStretchLastSection(False)
self.downloadList.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch)
self.downloadList.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch)
self.downloadList.setSelectionBehavior(QTableView.SelectRows)
self.downloadList.setAttribute(Qt.WA_TranslucentBackground)
self.downloadList.viewport().setAttribute(Qt.WA_TranslucentBackground)
+16
View File
@@ -4,6 +4,7 @@ from core.utils.data.state import state
from core.utils.general.logs import update_download_completed_by_hash
from core.utils.general.logs import consoleLog
from plyer import notification
import socket
import time
import sys
@@ -42,6 +43,21 @@ def aria2server():
stderr=subprocess.DEVNULL,
creationflags=subprocess.CREATE_NO_WINDOW if sys.platform == 'win32' else 0
)
max_checks = 50
for check in range(max_checks):
try:
sock = socket.socket()
sock.settimeout(0.1)
sock.connect(("localhost", 6800))
sock.close()
break
except(ConnectionRefusedError, socket.timeout):
time.sleep(0.1)
else:
raise RuntimeError("Aria2 Server failed to start")
consoleLog("Aria2 Server started")
return aria2server
def dlprogress():
+5 -2
View File
@@ -8,8 +8,11 @@ def start_client():
consoleLog("Started Aria2p")
def add_magnet(uri):
aria2.add_magnet(uri)
consoleLog("Magnet URI added to Aria2")
if uri is not None and uri.startswith("magnet:?"):
aria2.add_magnet(uri)
consoleLog("Magnet URI added to Aria2")
else:
consoleLog(f"Invalid Magnet Link: {uri}")
-1
View File
@@ -1,4 +1,3 @@
from core.utils.data.state import state
from core.utils.general.logs import consoleLog
from core.utils.network.download import run_download_direct