Retag Tools
These scripts fix ID3 metadata inside the audio files themselves. They are used after registry cleaning to make the files carry the same clean metadata the scheduler sees.
scripts/retag_files.js
Writes clean values back into each file's tags in place:
- Sets
TIT2(title) andTPE1(artist) from the cleansed registry. - Uses stream copy to avoid re-encoding:
ffmpeg -i <file> -c:a copy -id3v2_version 3 -metadata title="..." -metadata artist="..." <file>
-id3v2_version 3 guarantees ID3v2.3 tags (max compatibility with broadcast
players and Icecast metadata display).
scripts/retag_library.js
A one-shot clean reload that restores a pristine library before re-running the pipeline from scratch:
- Archives the existing music library to
E:/radionew/media/pro_archive/music_retag_<timestamp>/. - Clears the registry (
meta_registry.json) so everything re-registers. - Backs up
yt_download_archive.txtand truncates it, so previously downloaded videos can be re-fetched with fresh metadata.
When to run it
- After a bulk import of low-quality or mis-tagged files.
- When the registry's clean metadata no longer matches the files' embedded tags and you want the files fixed too.
- As part of a full library reset / "retag" campaign.
warning
retag_library.js moves files into an archive and clears the download archive —
verify your backups before running it. It is destructive by design.
Recommended workflow
1. scripts/reprobe_registry.js # rebuild registry from files
2. scripts/sanitize_registry.js # clean artist/title in registry
3. scripts/retag_files.js # write clean tags back into files
4. pipeline run # re-validate + loudness + sync