Scripts & Tools (scripts/)
The scripts/ directory holds operational utilities for the pipeline, metadata,
and monitoring.
Content pipeline CLI — run-content-pipeline.js
Wrapper that drives content-pipeline.js with flags:
| Flag | Meaning |
|---|---|
--sweepers | Fetch/process sweepers |
--mashups | Fetch/process mashups |
--sfx | Fetch/process SFX |
--songs=N | Fetch/process N songs |
--ads=N | Fetch/process N ads |
--no-fetch | Skip downloads, process existing downloads only |
--no-purge | Keep source files after processing |
--count | Print counts and exit |
--ids | Operate on specific video IDs |
Example:
node run-content-pipeline.js --songs=20 --sweepers --no-fetch
Media sync — sync-media-full.js
One-shot full mirror of the local library to sms@10.10.8.230:/home/sms/radio/media.
- Extensions:
.mp3,.ogg,.wav - Idempotent: skips files that already exist with the same size.
- Use after bulk library changes. See Media sync.
Registry repair
| Tool | Purpose |
|---|---|
sanitize_registry.js | Re-derive clean {artist, title} from embedded TIT2 for all registry entries (no file re-probe) |
reprobe_registry.js | Rebuild meta_registry.json from scratch by re-probing ID3 with ffprobe |
See Registry & Metadata.
Retagging
| Tool | Purpose |
|---|---|
retag_files.js | Write clean TIT2/TPE1 back into files in place (-c:a copy -id3v2_version 3) |
retag_library.js | One-shot clean reload: archive music to pro_archive/music_retag_<stamp>, clear registry, back up + truncate the download archive |
See Retag tools.
Rundown — regenerate-rundown.js
Generates the per-category JSON rundown with ffprobe (defaults LOKLOK System /
energy 5). See Rundown generation.
Smoke test — test-youtube-fetch.js
A standalone smoke test for the scheduler's fetchFromYouTube, fetching a test
playlist (E:/radionew/playlists/test.m3u) to verify the YouTube integration
works end-to-end.
Typical maintenance sequence
- Fix tags:
reprobe_registry.js→sanitize_registry.js→retag_files.js. - Refresh content:
run-content-pipeline.js --songs=20. - Sync:
sync-media-full.js(full) or rely on the engine's incremental sync. - Inventory:
regenerate-rundown.js. - Verify:
/api/content/status,/api/status, and the monitor page.