video: fix Play/Trailer buttons vanishing on owned movies

maybeRefreshMovie re-fetched the library payload (no trailer/server — those come
from the extras call) and replaced data, so renderActions re-rendered without the
buttons right after they appeared. It now carries over the live extras fields
(server/trailer/next_episode), mirroring the show reloadDetail fix.
This commit is contained in:
BoulderBadgeDad 2026-06-15 12:28:32 -07:00
parent 3f439e4277
commit 1423e50ccd

View file

@ -939,7 +939,15 @@
fetch(DETAIL_URL + 'movie/' + id, { headers: { 'Accept': 'application/json' } })
.then(function (r) { return r.ok ? r.json() : null; })
.then(function (d) {
if (d && !d.error && currentId === id) { data = d; renderBillboard(d); renderDetails(d); }
if (d && !d.error && currentId === id) {
// Keep the live extras (server/trailer/next-ep) the
// detail payload lacks — else Play/Trailer vanish.
var prev = data || {};
d.server = prev.server || null;
d.trailer = prev.trailer || null;
d.next_episode = prev.next_episode || null;
data = d; renderBillboard(d); renderDetails(d);
}
});
}
}).catch(function () { /* best-effort */ });