Skip to content

feat(sample-data): add SampleData module to import a sample station - #211

Draft
sreeshanth-soma wants to merge 2 commits into
openbroadcaster:5.5-developfrom
sreeshanth-soma:sample-data
Draft

sreeshanth-soma wants to merge 2 commits into
openbroadcaster:5.5-developfrom
sreeshanth-soma:sample-data

Conversation

@sreeshanth-soma

@sreeshanth-soma sreeshanth-soma commented Apr 30, 2026 •

Copy link
Copy Markdown
Member

Closes #141

Summary

Adds a SampleData module that sets up a sample station on a fresh install, based on the English Community Radio spec and the Pyrate 3 data. Run it from Admin > Import Sample Data, or with cli/ob sample data import en_community_radio.

A profile is a folder of JSON under profiles/, so adding one (French, for example) needs no code change. The format is in the module README.

This replaces the earlier draft.

What it imports

  • The spec's 20 categories and its genre lists
  • Basic and Manager groups
  • Login message, welcome page and every media format core accepts
  • 3 custom fields and 2 daypart examples
  • 45 media files from the zip on the OB site, saved through core
  • Pyrate's 9 playlists and 6 of its 7 shows
  • A player with a generated sync password, shown once

It can be run again and only adds what's missing. An install with its own content has to confirm first, and its own media, playlists and players aren't touched.

Not included

  • Sample users, since fixed passwords shouldn't be in a public repo. I can add them with generated passwords if we want them.
  • Admanager and Statistics, until they're on 5.5.
  • Pyrate's 21:00 Live Assist show, which would leave about 24 minutes of silence a day with nobody at the desk.

Notes

The controller reads php://input itself, because api.php only parses v2 request data when there's an Authorization header and the web UI sends X-Auth-*. If you'd rather fix that in api.php, it comes out.

The model ends its transactions with autocommit(true) rather than DB::commit(). DB::commit() sends COMMIT();, which is a syntax error on MySQL and MariaDB and showed up as a PHP warning during the command-line import.

Testing

Tested on MariaDB 10.11 with PHP 8.3, MySQL 9.6 with PHP 8.5, and MySQL 8.4 with nginx and php-fpm, including interrupted imports and web server timeouts. A real OBPlayer synced the imported station and played it.

@sreeshanth-soma
sreeshanth-soma marked this pull request as draft May 1, 2026 01:04
@sreeshanth-soma
sreeshanth-soma force-pushed the sample-data branch 2 times, most recently from 69a833e to b5c1aa9 Compare June 1, 2026 00:10
@sreeshanth-soma sreeshanth-soma changed the title sample data seeding system for fresh installs (issue #141) feat(sample-data): add SampleData module to import a sample station Nov 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant