video: fix stuck ep-sync banner + vanishing Play/Trailer buttons on shows

Two bugs when a show's episode list backfills on view:
- The 'Fetching full episode list…' banner never hid: .vd-ep-syncing (and
  .vd-next-ep) set display:flex, which overrode the [hidden] attribute's
  display:none, so el.hidden=true did nothing. Added a guard so [hidden] always
  wins on the detail/search/person pages.
- Play & Trailer buttons vanished after the sync: reloadDetail replaced data with
  a fresh show_detail payload (no server/trailer — those come from extras), so
  renderActions re-rendered without them. reloadDetail now carries over the live
  extras fields (server/trailer/next_episode).
This commit is contained in:
BoulderBadgeDad 2026-06-15 10:32:04 -07:00
parent 81546cff69
commit b937343768
2 changed files with 12 additions and 0 deletions

View file

@ -771,6 +771,13 @@
.then(function (d) {
showEpSyncing(false);
if (!d || d.error || currentId !== id) return;
// Carry over the live extras (server / trailer / next-episode) the
// show_detail payload doesn't include, so the Play & Trailer buttons
// (and the next-ep banner) don't vanish on reload.
var prev = data || {};
d.server = prev.server || null;
d.trailer = prev.trailer || null;
d.next_episode = prev.next_episode || null;
data = d;
if (!seasonByNum(selectedSeason)) {
selectedSeason = d.seasons && d.seasons.length ? d.seasons[0].season_number : null;

View file

@ -1249,3 +1249,8 @@ a.vd-prov:hover img, a.vd-prov:hover .vd-prov-ph { border-color: rgba(var(--vd-a
}
@keyframes vd-ep-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vd-ep-syncing-spin { animation: none; } }
/* A class with an explicit `display` (e.g. .vd-ep-syncing/.vd-next-ep) otherwise
beats the UA [hidden]{display:none}, so toggling el.hidden wouldn't hide it.
Guarantee hidden always hides on the video detail/search/person pages. */
.vd-page [hidden], .vp-page [hidden], .vsr-page [hidden] { display: none !important; }