Social & Shorts (social, shorts)
Two community-facing categories round out the library: social posts (users submit audio → it is validated, mastered, ranked and injected ahead of the rolling library) and shorts (TikTok-derived Arabic clips, < 60 s).
Social posts (social-platform.js)
| Field | Value |
|---|---|
| Assets | media/social/<type>/SOC_<id>_*.mp3 |
| Store | E:\radionew\social\posts.json |
| Log | E:\radionew\logs\social_platform.log |
| Type mapping | song→arabic_hits, mashup→mashups, ads→ads, jingles→jingles, sweepers/voice→sweepers, sfx→sfx |
Submission pipeline: listeners upload audio → engine validates, R128-masters
(normalizeR128), tags (deriveMeta), dedupes (registry dupKey) →
approved/rejected → ranked → injected as a scheduler overlay so top posts air
ahead of the rolling library.
Ranking equation
Posts are ranked by a weighted score — higher rank = airs first in the category overlay:
with per-type duration windows and RANK weights as the tuning seams (TYPES /
RANK consts in social-platform.js). Play counts auto-sync from
play_history.jsonl (matched on SOC_ filenames).
Scheduler hook
scheduler.setSocialDeck(cat, posts) / clearSocialDeck() / this.socialDeck
— updateM3U prepends each category's ranked overlay to its snapshot (empty
overlay = zero behaviour change). attachScheduler(sched) rebuilds it at boot
and in resyncSchedulerAfterRefresh; dead post paths are dropped before
snapshotting.
Shorts (shorts)
shorts is the TikTok transcoder category — Arabic clips < 60 s fetched and
transcoded into the rotation. It is treated as imaging-ish for crossfade purposes
(liq_cross_duration = 0.2, below its shortest clip) but airs like music.
Endpoints
GET/POST /api/social/posts…,/api/social/upload/:type, votes, reacts, approve/reject/process,POST /api/social/sync,GET /api/social/status,GET /api/social/next.- Studio UI:
http://10.40.3.174:5000/social.html(submit file/URL, vote, approve/reject/re-process, force rotation sync, live rank board). - MCP:
fetch_contentwithcategory=shortsroutes to the TikTok transcoder.
Verify on air
- Approved social posts appear at the head of their category in
/api/upnext. shortsclips air withliq_cross_duration=0.2annotation.social/posts.jsonstatuses reflect the approve/reject workflow.