fix: use backdrop_path for torrent-modal thumbnail; drop CSS bg fallback (native style)
This commit is contained in:
1 parent
8b68901d20
commit
9452239891
1 file changed
+10
-14
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user