Skip to main content

Rundown Generation (scripts/regenerate-rundown.js)

The rundown is a JSON snapshot of the current library organized by category — used for monitoring, inventory, and by the studio/injection tooling to know what is available right now.

How it works

  1. Walks each category directory.
  2. Probes every audio file with fluent-ffmpeg ffprobe to read duration and embedded metadata.
  3. Emits a rundown JSON document with per-category track listings.

Live directory map

The script uses a liveDirs map tying each on-air role to a category directory:

CategoryRole
arabic_hitsMain pop deck
arab_technoTechno/electronic deck
egyptian_trendsTrending/underground deck
bedsUnderscore beds (talk-over)
adsCommercials
jinglesStation jingles
sfxSound effects
sweepersSweepers / short station IDs
mashupsMashup content
influencersSocial-influencer clips

Record defaults

When a file has no readable tags, the rundown falls back to:

  • artistLOKLOK System
  • energy5 (default energy rating)

The same fallback philosophy applies throughout the pipeline: unreadable or missing metadata never crashes a run — it degrades to safe defaults.

Typical output shape

{
"arabic_hits": [
{ "file": "music/arabic_hits/amr_diab_x.mp3", "duration": 271.3, "artist": "Amr Diab", "title": "…", "energy": 5 }
],
"sweepers": [
{ "file": "imaging/sweepers/loklok_id_01.mp3", "duration": 4.2, "artist": "LOKLOK System", "title": "…", "energy": 5 }
]
}

Run it after a pipeline pass to produce an up-to-date inventory of everything the station can play.