From dc933d54f3f6af3b65f54c1c2cfc51590ebeb1ea Mon Sep 17 00:00:00 2001 From: shayaa <101264710+Vxrtrauter@users.noreply.github.com> Date: Sat, 31 Jan 2026 04:36:49 +0100 Subject: [PATCH] fix broken merge --- core/interface/gui.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/interface/gui.py b/core/interface/gui.py index cff36a3..1219a40 100644 --- a/core/interface/gui.py +++ b/core/interface/gui.py @@ -294,11 +294,18 @@ class MainWindow(QtWidgets.QMainWindow, QWidget): download = state.downloads[index.row()] button = editor.findChild(QtWidgets.QPushButton) + paused = index.data(Qt.UserRole) + + magnet_link = list(state.active_downloads.keys())[index.row()] + magnetdl = state.active_downloads[magnet_link] + status = magnetdl.status() + if button: - if download.progress == 100: + if status.state == lt.torrent_status.seeding: button.setText("📁") else: - button.setText("▶︎" if download.is_paused else "⏸︎") + button.setText("▶︎" if status.paused else "⏸︎") + def createEditor(self, parent, option, index): @@ -308,10 +315,10 @@ class MainWindow(QtWidgets.QMainWindow, QWidget): widget.setStyleSheet("border: none;") layout = QHBoxLayout(widget) layout.setContentsMargins(0, 0, 0, 0) - if download.progress == 100: + if status.state == lt.torrent_status.seeding: btnPause = QtWidgets.QPushButton("📁") else: - btnPause = QtWidgets.QPushButton("▶︎" if download.is_paused else "⏸︎") + btnPause = QtWidgets.QPushButton("▶︎" if status.paused else "⏸︎") btnPause.setFixedSize(40, 30) btnPause.clicked.connect(lambda: self.clicked.emit(index.row())) layout.addStretch()