feat(backend): signage schedules: which playlist plays when, switching by itself (platform-v2 step 5.4d)
- signage_schedules (Alembic 0030): entries {playlist, days, hours (may pass
midnight), dates, priority} and a fallback playlist. A screen's `schedule`
(ref) wins over its single playlist.
- services/signage_schedule.pick (pure): highest priority, then the most
specific (dates > days > hours), then the later entry; no match → fallback.
- GET /api/signage/screen with a schedule: the schedule (with the venue's time
zone) and every playlist in it, `playlist` = the one playing now, so the
player can switch while the server is down.
- schedule_worker (signage module, 30 s) tells a screen when its pick changes.
- /api/signage/schedules CRUD (playing now, the screens on it); deleting a
playlist takes it out of schedules; changes reach screens through schedules.
- Devices page: a signage screen's Schedule.
- tests: test_signage_schedule.py (6); 526 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -108,6 +108,7 @@ CODES: dict[str, tuple[int, str]] = {
|
||||
"signage.playlist_unknown": (404, "Playlist {playlist_id} not found."),
|
||||
"signage.slide_unknown": (404, "Slide {slide_id} not found."),
|
||||
"signage.not_a_screen": (404, "Device {device_id} isn't a signage screen."),
|
||||
"signage.schedule_unknown": (404, "Schedule {schedule_id} not found."),
|
||||
"signage.not_a_video": (422, "Pick a video for this slide."),
|
||||
"signage.content_invalid": (422, "This slide's setting isn't valid ({field}: {reason})."),
|
||||
"signage.order_mismatch": (409, "The playlist changed in the meantime. Reload it and try again."),
|
||||
|
||||
Reference in New Issue
Block a user