Skip to main content

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)

FieldValue
Assetsmedia/social/<type>/SOC_<id>_*.mp3
StoreE:\radionew\social\posts.json
LogE:\radionew\logs\social_platform.log
Type mappingsong→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:

rank(p)=wvotesVp+wreactsRp+wplaysPp+wfreshe(agep/τ)\mathrm{rank}(p) = w_{votes} \cdot V_p + w_{reacts} \cdot R_p + w_{plays} \cdot P_p + w_{fresh} \cdot e^{-(age_p / \tau)}

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.socialDeckupdateM3U 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_content with category=shorts routes to the TikTok transcoder.

Verify on air

  1. Approved social posts appear at the head of their category in /api/upnext.
  2. shorts clips air with liq_cross_duration=0.2 annotation.
  3. social/posts.json statuses reflect the approve/reject workflow.