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:
2026-11-17 18:47:33 +02:00
co-authored by Claude Opus 5.5
parent b5951ba373
commit 0d766d3c86
15 changed files with 493 additions and 30 deletions
+2 -1
View File
@@ -147,6 +147,7 @@
"not_a_video": "Διαλέξτε βίντεο για αυτή τη διαφάνεια.",
"content_invalid": "Μια ρύθμιση της διαφάνειας δεν είναι έγκυρη ({{field}}: {{reason}}).",
"order_mismatch": "Η λίστα άλλαξε στο μεταξύ. Φορτώστε τη ξανά και δοκιμάστε πάλι.",
"weather_offline": "Η υπηρεσία καιρού δεν είναι διαθέσιμη: ο διακομιστής του καταστήματος χρειάζεται internet γι' αυτήν."
"weather_offline": "Η υπηρεσία καιρού δεν είναι διαθέσιμη: ο διακομιστής του καταστήματος χρειάζεται internet γι' αυτήν.",
"schedule_unknown": "Το πρόγραμμα {{schedule_id}} δεν βρέθηκε."
}
}
+5
View File
@@ -393,6 +393,11 @@
"hint": "Τι παίζει αυτή η οθόνη (Προβολή).",
"none": "Τίποτα (κενή οθόνη)"
},
"schedule": {
"label": "Πρόγραμμα",
"hint": "Παίζει τις λίστες του στις μέρες και ώρες τους· αντί για τη λίστα παραπάνω.",
"none": "Χωρίς πρόγραμμα (παίζει τη λίστα)"
},
"orientation": {
"label": "Προσανατολισμός",
"hint": "Πώς κρέμεται η τηλεόραση: οι διαφάνειες φτιάχνονται για αυτό το σχήμα.",
+2 -1
View File
@@ -147,6 +147,7 @@
"not_a_video": "Pick a video for this slide.",
"content_invalid": "This slide's setting isn't valid ({{field}}: {{reason}}).",
"order_mismatch": "The playlist changed in the meantime. Reload it and try again.",
"weather_offline": "The weather service can't be reached: the venue's server needs internet for it."
"weather_offline": "The weather service can't be reached: the venue's server needs internet for it.",
"schedule_unknown": "Schedule {{schedule_id}} not found."
}
}
+5
View File
@@ -393,6 +393,11 @@
"hint": "What this screen plays (Signage).",
"none": "Nothing (a blank screen)"
},
"schedule": {
"label": "Schedule",
"hint": "Plays its playlists at their days and hours; used instead of the playlist above.",
"none": "No schedule (play the playlist)"
},
"orientation": {
"label": "Orientation",
"hint": "How the TV hangs: slides are built for this shape.",