fix: open folder because state.download_path is None in gui.py

This commit is contained in:
2026-02-04 19:35:35 +01:00
parent e95ad11672
commit b7ca895aeb
+5 -4
View File
@@ -273,13 +273,14 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
status = magnetdl.status() status = magnetdl.status()
if status.state == lt.torrent_status.seeding: if status.state == lt.torrent_status.seeding:
if state.download_path and os.path.exists(state.download_path): save_path = magnetdl.save_path()
if save_path and os.path.exists(save_path):
if platform.system() == "Windows": if platform.system() == "Windows":
os.startfile(os.path.normpath(state.download_path)) os.startfile(os.path.normpath(save_path))
elif platform.system() == "Linux": elif platform.system() == "Linux":
subprocess.Popen(["xdg-open", state.download_path]) subprocess.Popen(["xdg-open", save_path])
elif platform.system() == "Darwin": elif platform.system() == "Darwin":
subprocess.Popen(["open", state.download_path]) subprocess.Popen(["open", save_path])
return return
if status.paused: if status.paused: