dragonflight/services/mam-api/src
Zac ca71e47035 fix(playout): repair failover, authenticate scheduler self-calls, fix playlist walk + CasparCG consumer syntax
Post-review fixes for the 8-commit playout-mcr drop:

- Scheduler self-calls (callSelf -> /recorders, /playout) carried no auth, so
  under AUTH_ENABLED=true requireUiHeader 403'd every mutating POST. This broke
  playout failover AND scheduled recordings. Add a per-boot in-process service
  token (x-internal-token) the scheduler attaches; requireAuth/requireUiHeader
  treat it as the seeded admin. No env/compose config needed.

- Failover deadlocked: restartChannel set status='starting' then the scheduler
  called the guarded /start route, which 409s on 'starting'. Extract the spawn
  body into spawnChannelSidecar() shared by /start and restartChannel; failover
  now spawns directly with no self-call.

- Phase A playlist stalled after 2 clips: _scheduleAdvance cued the next clip
  via LOADBG AUTO but never advanced the pointer. Pass asset_duration_ms in the
  /play payload and arm a duration-based timer that advances currentIndex and
  cues subsequent clips, keeping as-run in sync for arbitrary-length playlists.

- CasparCG consumer syntax was invalid: "ADD <ch> FFMPEG" is the producer name,
  not a consumer keyword, and old -vcodec/-acodec short args are rejected. Use
  STREAM/FILE with -codec:v / -codec:a / -preset:v / -tune:v and a format=yuv420p
  filter ahead of libx264 (channel output is RGBA).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 14:51:35 +00:00
..
ampp feat: AMPP folder sync integration — pre-create folder hierarchy on upload, expose lookup endpoint for Script Task: client.js 2026-04-18 13:42:07 -04:00
auth fix(mam-api): harden TOTP login flow + tighten Google domain check 2026-05-30 12:52:53 +00:00
db feat(mam-api): migration 029 — playout schema 2026-05-30 14:02:25 +00:00
middleware fix(playout): repair failover, authenticate scheduler self-calls, fix playlist walk + CasparCG consumer syntax 2026-05-30 14:51:35 +00:00
routes fix(playout): repair failover, authenticate scheduler self-calls, fix playlist walk + CasparCG consumer syntax 2026-05-30 14:51:35 +00:00
s3 fix(s3): land NodeHttpHandler request/connection timeout in main 2026-05-29 17:26:59 -04:00
tasks Revert "auth: top-to-bottom rework — local accounts, RBAC + client tag, audit log, env-bootstrap" 2026-05-27 03:28:05 +00:00
index.js feat(mam-api): /playout control plane + auto-failover 2026-05-30 14:02:25 +00:00
scheduler.js fix(playout): repair failover, authenticate scheduler self-calls, fix playlist walk + CasparCG consumer syntax 2026-05-30 14:51:35 +00:00