2020-06-02, 18:07
Code:
I had some old lossless wma files which I wanted to convert into flac to fix some tag issues. Procedure as follows:
1. Take some working wma files with extended Picard tags
2. Pass them through soundconverter -> receive flacs with only some basic tags remaining
3. Compare random files in audacity (invert one wav and mix together to get silence) to make sure conversion went well
4. Run Picard on them -> be happy to get all metadata back
5. Copy to Kodi -> done? nope, get every new track skipped
Seems like a some tag compatibility issue, so then:
1. Take official tools (flac package)
2. Since it's now hard to distinguish converted files, get excited to treat whole library
3. Retrieve tags into txt, sort them nicely A-Z, strip all tags from flac and re-apply from txt back into files:
4. Reencode library with latest encoder just to make sure:xml:for i in STORAGE/music/*/*.flac; do $(metaflac --export-tags-to tag "$i"); sort tag > tag_sorted; $(metaflac --preserve-modtime --remove-all-tags --import-tags-from tag_sorted "$i"); done
5. Check if tracks are error-free:xml:for i in STORAGE/music/*/*.flac; do $(flac "$i" -V --force --preserve-modtime -5); done
6. Tracks which worked fine still do, new ones still get skippedxml:find . -type f -iname '*.flac' -print0 | xargs --null flac -wst
7. Give up and search for help