play: always use native Lampa.Player.play with torrent_hash (Lampa routes to system torrent player)

This commit is contained in:
Hermes committed 2026-08-09 14:13:24 +02:00
1 parent 814589ca1b
commit d4c3c7f7e7
1 file changed
+4 -8
+4 -8
View File
@@ -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).
$('<a href="' + url + '"></a>')[0].click();
return;
}
Lampa.Player.play(data);
}