You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrate format_presets.py to spec + code generation #185
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
format_presets should be generated from a spec in the format #182 introduces. Studio, Kolibri and ricecooker read its field names and list order, so its public Python API should not change.
Complexity: Medium Target branch: main
Context
32 presets. Constant names don't derive from ids (VIDEO_HIGH_RES = "high_res_video"), and each preset also has a <NAME>_READABLE constant used as its choices label.
Six presets have a _READABLE constant that differs from their readable_name in PRESETLIST: video_dependency, audio_dependency, html5_dependency, h5p, qti, slideshow_image.
VIDEO_VECTOR has constants but no record and no choices entry.
Where a preset's _READABLE constant and readable_name differ, the spec should hold both, so neither changes.
js/FormatPresets.js should export the constants as its default export and the preset records as a named export.
Acceptance Criteria
le_utils/constants/format_presets.py and js/FormatPresets.js are generated from spec/constants-format_presets.json, presetlookup.json is deleted, and make build on a clean checkout leaves no diff.
Activity