From d4c3c7f7e7b030e40aa5e8f26eb34c0e48d236b0 Mon Sep 17 00:00:00 2001 From: Hermes Date: Sun, 9 Aug 2026 14:13:24 +0200 Subject: [PATCH] play: always use native Lampa.Player.play with torrent_hash (Lampa routes to system torrent player) --- plugin.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugin.js b/plugin.js index e5ad8eb..c8eb297 100644 --- a/plugin.js +++ b/plugin.js @@ -383,8 +383,10 @@ function play(m) { // Native Lampa torrent playback: pass the magnet url + torrent_hash. - // On Android/TV (no Torserver) Lampa routes the magnet to the system torrent - // player; with Torserver it streams via the built-in player. + // Lampa routes it correctly on every platform: + // - Android/TV without Torserver -> opens the system torrent player (Android.openTorrent) + // - with Torserver configured -> streams via the built-in player + // - web without Torserver -> Torserver prompt / magnet fallback var url = m.magnet ? m.magnet : resolve(m.torrent); if (!url) return; var data = { @@ -395,12 +397,6 @@ episode: 0 }; if (m.hash) data.torrent_hash = m.hash; - if (Lampa.Torserver && Lampa.Torserver.url && !Lampa.Torserver.url()) { - // No torrent server configured: fall back to opening the magnet link directly - // (Android opens it in the torrent client; web triggers a download/play). - $('')[0].click(); - return; - } Lampa.Player.play(data); }