Repository navigation
feat(sample-data): add SampleData module to import a sample station - #211
Draft
sreeshanth-soma wants to merge 2 commits into
Draft
sreeshanth-soma wants to merge 2 commits into
sreeshanth-soma wants to merge 2 commits into
Conversation
sreeshanth-soma
marked this pull request as draft
May 1, 2026 01:04
sreeshanth-soma
force-pushed
the
sample-data
branch
2 times, most recently
from
June 1, 2026 00:10
69a833e to
b5c1aa9
Compare
sreeshanth-soma
force-pushed
the
sample-data
branch
from
November 8, 2026 18:10
b5c1aa9 to
57b643c
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #141
Summary
Adds a
SampleDatamodule 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 withcli/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
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
Notes
The controller reads
php://inputitself, becauseapi.phponly parses v2 request data when there's anAuthorizationheader and the web UI sendsX-Auth-*. If you'd rather fix that inapi.php, it comes out.The model ends its transactions with
autocommit(true)rather thanDB::commit().DB::commit()sendsCOMMIT();, 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.