From 8017f966540f8ab06677ff71e2ea412cdc7d0228 Mon Sep 17 00:00:00 2001 From: Hermes Date: Mon, 10 Aug 2026 01:10:48 +0200 Subject: [PATCH] fix: modal thumbnail via active.movie (drop backdrop_path); native-like bg blur --- plugin.js | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/plugin.js b/plugin.js index 8f91bab..057bcaf 100644 --- a/plugin.js +++ b/plugin.js @@ -398,8 +398,10 @@ // builds them lazily). Retry a couple of times, but never re-add the // controller or steal focus once it's already set. apply(); - // Native Lampa detail background: blurred fanart behind the page. - // Set it in start() (after the activity is live), exactly like Lampa does. + // Detail background: blurred fanart, matching Lampa's native canvas blur. + // Lampa.Background.immediately() is throttled / gated by settings, so we + // also set the .background element directly. Mimic Lampa's look: + // heavy blur + darken + slight scale so edges don't show. try { var dm = resolveMovie((comp.activity && comp.activity.object) || selected); var bg = resolve(dm.img || dm.poster || dm.cover); @@ -407,6 +409,16 @@ if (bg && Lampa.Background && Lampa.Background.immediately) { Lampa.Background.immediately(bg); } + var bgel = document.querySelector('.background'); + if (bg && bgel) { + bgel.style.backgroundImage = 'url("' + bg + '")'; + bgel.style.backgroundSize = 'cover'; + bgel.style.backgroundPosition = 'center'; + bgel.style.backgroundRepeat = 'no-repeat'; + bgel.style.filter = 'blur(30px) brightness(0.45)'; + bgel.style.transform = 'scale(1.1)'; + bgel.style.opacity = '1'; + } } catch (e) { console.log('[mymovies] bg err', e); } if (!$('.mymovies-detail .full-start-new__buttons .full-start__button.selector').length) { setTimeout(apply, 300); @@ -490,7 +502,8 @@ component: PLUGIN.name + '_detail', title: m.title, page: m.title, - object: m + object: m, + movie: m }); } @@ -502,18 +515,17 @@ var magnet = m.magnet || ('magnet:?xt=urn:btih:' + (m.hash || '')); if (magnet.indexOf('magnet:') !== 0) return; var imgUrl = resolve(m.img || m.poster || m.cover); - // Lampa's torrent modal sets the thumbnail from `movie.backdrop_path` - // (see list$1: element.img = Api.img(params.movie.backdrop_path)). - // Api.img() passes a full http(s) URL through unchanged, so we can - // point backdrop_path at our horizontal movie.jpg and it will be used. + // The torrent modal (.files template) reads `params.movie.img` directly + // into . We pass a full http(s) URL so it loads as-is. + // NOTE: do NOT set `backdrop_path` — Lampa runs it through Api.img() + // (TMDB), which mangles a full URL into an invalid path. var element = { MagnetUri: magnet, title: m.title, poster: imgUrl, - img: imgUrl, - backdrop_path: imgUrl + img: imgUrl }; - var movie = Object.assign({}, m, { img: imgUrl, poster: imgUrl, backdrop_path: imgUrl }); + var movie = Object.assign({}, m, { img: imgUrl, poster: imgUrl }); console.log('[mymovies] play img=', imgUrl); Lampa.Torrent.start(element, movie); }