From 8d434cc114c4a79e51743103332cea55acb779d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Feh=C3=A9r=20Roland?= Date: Tue, 14 Oct 2025 12:57:30 +0200 Subject: [PATCH] Re-enable magnet button --- js/trdom_torrentcontrol.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/js/trdom_torrentcontrol.js b/js/trdom_torrentcontrol.js index 21ab87a..ab608fd 100644 --- a/js/trdom_torrentcontrol.js +++ b/js/trdom_torrentcontrol.js @@ -119,21 +119,14 @@ class trdom_torrentcontrol extends EventTarget { e.stopPropagation(); break; case 'magnet': - /*let magneturl; - for (const [srv, data] of Object.entries(this.#getKnownTorrents()[this.#hash].servers)) { - if (data.magnetLink != null) { - magneturl = data.magnetLink; - break; - } - } - if (magneturl != null) { - this.#server.torrent_add_url(magneturl, false, null); + e.stopPropagation(); + if (this.magnet != null) { + this.#server.torrent_add_url(this.magnet, true, null); } else { - this.#log(3, `Couldn't find magnet link! ${JSON.stringify(this.#getKnownTorrents()[this.#hash].servers)}`); - }*/ - e.stopPropagation(); - window.alert('not implemented'); + this.#log(3, 'Couldn\'t find magnet link!'); + window.alert('Couldn\'t find magnet link!'); + } break; case 'download': e.stopPropagation();