fix: use Torrent.start(element) with MagnetUri so Torserver.hash is reached (parser-equivalent path)
This commit is contained in:
1 parent
1339b82f4c
commit
c89784784c
1 file changed
+13
-4
@@ -374,12 +374,21 @@
|
||||
}
|
||||
|
||||
function play(m) {
|
||||
if (!m || !m.hash) return;
|
||||
// Native Lampa torrent playback: open the hash directly on the Torserver
|
||||
// stream (same path as a built-in torrent card) — no parser / search screen.
|
||||
if (!m) return;
|
||||
// Native Lampa torrent path (same as a parser card):
|
||||
// Torrent.start(element) -> Torserver.hash({link: element.MagnetUri})
|
||||
// -> Torserver.files(hash) -> Player.play. No parser screen.
|
||||
var magnet = m.magnet || ('magnet:?xt=urn:btih:' + (m.hash || ''));
|
||||
if (magnet.indexOf('magnet:') !== 0) return;
|
||||
var element = {
|
||||
MagnetUri: magnet,
|
||||
title: m.title,
|
||||
poster: resolve(m.poster || m.cover)
|
||||
};
|
||||
var movie = Object.assign({}, m, { img: resolve(m.poster || m.cover) });
|
||||
Lampa.Torrent.open(m.hash, movie);
|
||||
Lampa.Torrent.start(element, movie);
|
||||
}
|
||||
window.__mymovies_test_play = play;
|
||||
|
||||
// ---------- Menu item ----------
|
||||
// Lampa builds the main menu on the 'menu:start' event. We add our item via the
|
||||
|
||||
Reference in new issue
Block a user