diff --git a/plugin.js b/plugin.js index e5bf105..8f91bab 100644 --- a/plugin.js +++ b/plugin.js @@ -399,22 +399,13 @@ // 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), like Lampa does. + // Set it in start() (after the activity is live), exactly like Lampa does. try { var dm = resolveMovie((comp.activity && comp.activity.object) || selected); var bg = resolve(dm.img || dm.poster || dm.cover); console.log('[mymovies] bg=', bg); - if (bg) { - if (Lampa.Background && Lampa.Background.immediately) Lampa.Background.immediately(bg); - // Fallback: directly set the blurred background element Lampa uses. - var bgel = document.querySelector('.background'); - if (bgel) { - bgel.style.backgroundImage = 'url("' + bg + '")'; - bgel.style.backgroundSize = 'cover'; - bgel.style.backgroundPosition = 'center'; - bgel.style.filter = 'blur(15px)'; - bgel.style.opacity = '1'; - } + if (bg && Lampa.Background && Lampa.Background.immediately) { + Lampa.Background.immediately(bg); } } catch (e) { console.log('[mymovies] bg err', e); } if (!$('.mymovies-detail .full-start-new__buttons .full-start__button.selector').length) { @@ -511,13 +502,18 @@ 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. var element = { MagnetUri: magnet, title: m.title, poster: imgUrl, - img: imgUrl + img: imgUrl, + backdrop_path: imgUrl }; - var movie = Object.assign({}, m, { img: imgUrl, poster: imgUrl }); + var movie = Object.assign({}, m, { img: imgUrl, poster: imgUrl, backdrop_path: imgUrl }); console.log('[mymovies] play img=', imgUrl); Lampa.Torrent.start(element, movie); }