Cross post from [https://fillian.me/code/bongo-retag/](https://fillian.me/code/bongo-retag/)
​
[bongo](https://github.com/dbrock/bongo) is a package for listening to music within Emacs.
I keep all my music on my computer with filenames readable by bongo like this:
`Artist - Album - Track Num - Song Name.mp3`
​
I like having all the metadata stored in the filename instead of in internal ID3 tags for a few reasons:
* filenames are easy to change
* everything is visible at a glance
* it stops me from spending too much time re-tagging and organizing my library
​
The problem is that when I sync my music library to my phone using [Syncthing](https://syncthing.net/), the music app I use doesn't read the metadata from the filename - it uses the standard ID3 tags.
​
My solution was to write a small script which reads metadata from the filename and overwrites the internal ID3 tags to match.
Whenever I add new music to my library, I'll run this script and then I'll be able to browse easily on my phone. The source of truth for metadata will always be the filename.
​
The script is written in Python and requires a library called [eyeD3](https://eyed3.readthedocs.io/en/latest/)
You can find the it [here](https://github.com/will-hanlen/bongo-retag)
Pass the script a directory and it will re-tag all the .mp3 files inside and in any sub-directories.
​
It's nice to have album cover images when listening on my phone, so the script will overwrite a cover image if there is a file that matches `Artist - Album.jpg` in the same directory as the mp3.