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
- Walks each category directory.
- Probes every audio file with fluent-ffmpeg
ffprobeto read duration and embedded metadata. - 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:
| Category | Role |
|---|---|
arabic_hits | Main pop deck |
arab_techno | Techno/electronic deck |
egyptian_trends | Trending/underground deck |
beds | Underscore beds (talk-over) |
ads | Commercials |
jingles | Station jingles |
sfx | Sound effects |
sweepers | Sweepers / short station IDs |
mashups | Mashup content |
influencers | Social-influencer clips |
Record defaults
When a file has no readable tags, the rundown falls back to:
artist→LOKLOK Systemenergy→ 5 (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.