Social Platform (social-platform.js)
Lets listeners submit their own audio (songs, mashups, ads, jingles, sweepers, sfx, voice notes, talk show clips, programs) which the engine validates, masters to broadcast level, and — if approved — injects on air as a ranked overlay ahead of the rolling library.
Submission lifecycle
submit → validate (type + duration window) → R128 master → deriveMeta (tags)
→ dedupe (registry dupKey) → approved | rejected → ranked → scheduler overlay
- Submit —
POST /api/social/posts(JSON withsourceUrlorbase64) orPOST /api/social/upload/:type(raw audio body). - Validate — duration must fall inside the type's window.
- Master — reuses the pipeline
normalizeR128(EBU R128, −14 LUFS). - Tag —
deriveMetabuilds the metadata / registry entry. - Dedupe — a registry
dupKeyprevents double-submitting the same clip. - Rank — votes + recency + type
RANKweights decide the order. - Inject —
attachScheduler(sched)rebuilds the scheduler'ssocialDeck;updateM3Uprepends each category's ranked overlay to its snapshot. APOST /api/social/syncpushes the updated rotation to the remote.
Types (map to existing categories)
| Type | Category | Duration window | Label |
|---|---|---|---|
song | arabic_hits | 90–600s | Song |
mashup | mashups | 60–600s | Mashup |
jingles | jingles | 2–30s | Jingle |
sweepers | sweepers | 2–45s | Station ID / Sweeper |
sfx | sfx | 0.5–15s | Sound Effect |
ads | ads | 6–60s | Advertisement |
voice | sweepers | 3–120s | Voice Note / Dedication |
talk | talkshow | 120–5400s | Talk Show Episode |
program | programs | 120–10800s | Program / Show |
Storage
| Path | What |
|---|---|
E:\radionew\media\social\<type>\SOC_<id>_*.mp3 | Approved audio assets |
E:\radionew\social\posts.json | Post store (registry) |
E:\radionew\logs\social_platform.log | Activity log |
E:\radionew\logs\media\play_history.jsonl | Play counts (auto-matched by SOC_ filenames) |
API
Mounted by server.js via socialPlatform.mountRoutes(app, { express, radio }):
GET /api/social/posts[?status=&type=&sort=],GET /api/social/posts/:idPOST /api/social/posts(JSON),POST /api/social/upload/:type(raw audio)POST /api/social/posts/:id/vote {delta:±1},.../react {kind}POST /api/social/posts/:id/approve|reject|process(admin gate via envSOCIAL_ADMIN_KEY, empty = open)POST /api/social/sync,GET /api/social/status,GET /api/social/next
Studio UI
public/social.html (http://10.40.3.174:5000/social.html): submit (file or
URL), vote/react, approve/reject/re-process, force rotation sync, live rank board.
Scheduler integration
smart-scheduler.jsexposessocialDeck(setSocialDeck(cat, posts),clearSocialDeck(), init{}).updateM3Uprepends each category's ranked overlay to its snapshot (empty overlay = zero behaviour change).- Rebuilt at boot and inside
resyncSchedulerAfterRefresh.
See also
- Station control — the content/rotation API it shares.
- Content pipeline — the R128/deriveMeta primitives it reuses.