feat(backend): signage playlists and slides, screens, built-in pictures (platform-v2 step 5.4a)

- signage_playlists (name, orientation, default transition) and
  signage_slides (kind menu | image | video | text, position, duration,
  transition, video to its end, on/off, days / hours / dates, content typed
  per kind: extra fields refused, pictures / videos as media ids). Alembic 0029.
- /api/signage: playlists CRUD, duplicate, timeline order; slides add (at a
  position), change, delete, duplicate; screens (playlist, orientation,
  rotation, orientation mismatch). The screen's GET /api/signage/screen gives
  its playlist resolved for playing with a version hash. Changes send
  signage.changed only to the screens playing that playlist.
- Signage device config: playlist (ref signage_playlists), orientation,
  rotation. Slides register their media usage.
- Built-in pictures: assets/builtin_media/ imported at start
  (media.builtin), a collection of their own (?collection=builtin|own),
  never deleted or renamed (media.builtin).
- tests: test_signage.py (8); 509 passed. Pack README: the signage row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 18:35:13 +02:00
co-authored by Claude Opus 5.5
parent 51b764fe7e
commit 7fc32ad917
18 changed files with 951 additions and 7 deletions
+11 -3
View File
@@ -1,16 +1,24 @@
"""Module manifest — see core/modules/model.py and APPS_PLATFORM §4."""
from core.modules.model import DeviceApp, Limit, Module, Perm
from core.modules.model import ConfigField, DeviceApp, Limit, Module, Mount, Perm
MODULE = Module(
key='signage',
kind='app',
name='Digital signage',
description='Menus and promotions on TVs (phase 5).',
description='Menus and promotions on TVs: playlists of menu boards, pictures, videos and texts (phase 5, steps 5.4a-5.6c).',
permissions=(
Perm('signage.manage', 'Edit signage content', roles=('owner', 'store_manager', 'staff_manager')),
),
limits=(
Limit('devices', 'Number of signage screens', free=0, licensed_default=1),
),
device_app=DeviceApp(login_modes=('none',), scope=()),
routers=(
Mount('routers.signage', '/api/signage'),
),
device_app=DeviceApp(login_modes=('none',), scope=(), config=(
# What it plays and how the TV hangs (5.4a); the editor builds for the screen's shape
ConfigField('playlist', 'ref', default=None, choices_from='signage_playlists'),
ConfigField('orientation', 'enum', default='landscape', choices=('landscape', 'portrait')),
ConfigField('rotation', 'int', default=0, choices=(0, 90, 180, 270)),
)),
)