fix(signage): correct takeover, trigger and random playlist scheduling - #517
Conversation
- Random playlists keep one shuffled order until their media list changes. The playlist was rebuilt every 15 s tick with a new order, which restarted the item on screen. - Triggers fire only when their value turns true. Binding emitted the current value at once, so triggers fired on boot, on every display reload and when reset to false. - Only schedules marked as takeover start a takeover. A background schedule on a takeover playlist made it a full-screen takeover. - Single-pass takeovers are held after their 30 s trigger window until the player reports a full pass. They were cleared after ~2 items. - A takeover with no valid media does not start, so it cannot pause normal playback behind a blank screen. - Diagnostics report a running takeover over a background schedule.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This comment has been minimized.
This comment has been minimized.
The player ends an override at `ends_at` or after one pass, never both. A single pass that shared an override with a timed run was ended by the timed run's end time, kept a disabled timed playlist on screen, or was dropped when a new takeover started. Single-pass runs now play alone, ahead of timed runs, with `ends_at` 0. Held runs are kept when the override is rebuilt. A timed run is detected across its whole play period, so it starts or resumes after the pass and still ends at its scheduled time.
|
Re the outside-diff finding New takeover cuts off pass ( One known limit remains, outside this PR: if two single-pass runs overlap, they share one override. |
| const media = this._getPlaylistMedia( | ||
| display, | ||
| active_playlists.map((_) => _.id), | ||
| [...new Set(runs.map(({ playlist_id }) => playlist_id))], | ||
| () => true, | ||
| 'takeover', |
There was a problem hiding this comment.
When a playlist has a timed takeover listed before a single-pass takeover and both are active, the override picks the single pass but builds its media from the playlist's first active takeover schedule. That can give the media the timed run's expiry. If the timed run ends before the pass finishes, the player drops the remaining media and ends the pass early. Build the media using the selected single-pass run's window.
There was a problem hiding this comment.
Fixed in d3a6558. Added a single-pass schedule kind (a takeover with play_period 0). Single-pass overrides build their media with it, so a timed takeover on the same playlist no longer sets their validity window. Test: should not expire single-pass media with a timed run on the same playlist. It fails without the fix.
A playlist can have a timed and a single-pass takeover active at once. Single-pass media took the validity window of the first active takeover schedule, which could be the timed one. The pass then ended at the timed run's end. Add a `single-pass` schedule kind and use it to build media for single-pass overrides.
The player showed the wrong content in five scheduling cases:
play_period: 0) takeovers were cleared when their 30 s trigger window closed, after about 2 items.Changes
All in
apps/signage/src/app/signage.service.ts:activePlaylistSchedulestakes abackgroundortakeoverkind. Takeovers use only takeover schedules. Background playback and media validity windows use the schedule of the matching kind. The unusedtrigger_window_secondsargument is removed.playlist_through. The hold ends if the playlist is removed or disabled, is no longer a single-pass takeover, or has no valid media.state().playlists.activeshows a running takeover over a background schedule.ends_at0. Held runs are kept when the override is rebuilt. Timed runs start or resume after the pass and still end at their scheduled time. Single-pass media uses a newsingle-passschedule kind for its validity window.USER_STORIES.md(US-SIG-006, 019, 020) andDEBUGGING.mdare updated.Testing
develop.nx test signagepasses (378 tests).nx build signagepasses.nx lint signagehas 12 errors that are also ondevelop(selector prefixes, module boundaries intest-setup.ts).valid_fromtakeovers, triggers (realtime socket mocked), a plain playlist.Needs a decision
playlist_through. fix(signage): recover from stalled plugins, hung recovery and failed boot #518 adds a limit for plugins that never finish, which is the likely cause of a missing report.play_period: 0: the local stack's backend returns "play_period must be greater than 0", but the manager schedule form can send 0. Please check the production backend.Merge order
Independent of #518 and #519, but all three add rows to the symptom table in
apps/signage/DEBUGGING.md. The second and third to merge need a rebase. Based ondevelop.Changes made by Claude Opus 5.5 (1M context) in Claude Code, running in T3 Code.
🤖 Generated with Claude Code