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();