Hi all,
Loved seeing the chatter on the forums and thought I’d share these two tagger scripts.
When I convert Flac to MP3 using FFMpeg, when it moves from the vorbis wrapper to the id3v2 wrapper, it maintains the metadata as-is, so it looks mangled when loading in MP3s.
My script to auto-convert these using only ffmpeg and gnu-parallel
find . -type f -name "*.flac" | parallel --jobs "$(nproc)" output="{.}.mp3"\; ffmpeg -i {} -ab 320k -map_metadata 0 -id3v2_version 3 -map 0:a -map 0:v -c:v copy "\$output"\;
You can lob an rm {}
on the end to make parallel clean up after itself if you’re brave.
Well here is my attempt at autofixing those tagging issues.
# FLAC to MP3 (or vorbis)
$if($not(%ab:genre%),$setmulti(ab:genre,%AB:GENRE%,;)$delete(AB:GENRE))
$if($not(%ab:mood%),$setmulti(ab:mood,%AB:MOOD%,;)$delete(AB:MOOD))
$if(%artists%,$setmulti(artists,%artists%,;))
$if($not(%artistsort%),$set(artistsort,%ARTISTSORT%)$delete(ARTISTSORT))
$if($not(%bpm%),$set(bpm,%BPM%)$delete(BPM))
$if(%CDTOC%,$delete(CDTOC))
$if($not(%comment%),$set(comment,%COMMENT%)$delete(COMMENT))
$if($and($not(%totaldiscs%),%DISCTOTAL%),$set(totaldiscs,%DISCTOTAL%)$delete(DISCTOTAL))
$if($and($not(%discsubtitle%),%DISCSUBTITLE%),$set(discsubtitle,%DISCSUBTITLE%)$delete(DISCSUBTITLE))
$if($and($not(%totaldiscs%),%TOTALDISCS%),$set(disctotal,%TOTALDISCS%)$delete(TOTALDISCS))
$if(%TOTALDISCS%,$delete(TOTALDISCS))
$if($not(%engineer%),$set(engineer,%ENGINEER%)$delete(ENGINEER))
$if($not(%isrc%),$setmulti(isrc,%ISRC%,;)$delete(ISRC))
$if($not(%key%),$set(key,%KEY%)$delete(KEY))
$if($not(%label%),$set(label,%LABEL%)$delete(LABEL))
$if($not(%labelno%),$set(labelno,%LABELNO%)$delete(LABELNO))
$if($not(%media%),$set(media,%MEDIA%)$delete(MEDIA))
$if($not(%musicbrainz_albumartistid%),$set(musicbrainz_albumartistid,%MUSICBRAINZ_ALBUMARTISTID%)$delete(MUSICBRAINZ_ALBUMARTISTID))
$if($not(%musicbrainz_albumid%),$set(musicbrainz_albumid,%MUSICBRAINZ_ALBUMID%)$delete(MUSICBRAINZ_ALBUMID))
$if($not(%musicbrainz_artistid%),$setmulti(musicbrainz_artistid,%MUSICBRAINZ_ARTISTID%,;)$delete(MUSICBRAINZ_ARTISTID))
$if($not(%musicbrainz_releasegroupid%),$set(musicbrainz_releasegroupid,%MUSICBRAINZ_RELEASEGROUPID%)$delete(MUSICBRAINZ_RELEASEGROUPID))
$if($not(%musicbrainz_recordingid%),$set(musicbrainz_recordingid,%MUSICBRAINZ_TRACKID%)$delete(MUSICBRAINZ_TRACKID))
$if($not(%musicbrainz_trackid%),$set(musicbrainz_trackid,%MUSICBRAINZ_RELEASETRACKID%)$delete(MUSICBRAINZ_RELEASETRACKID))
$if($not(%originaldate%),$set(originaldate,%ORIGINALDATE%)$delete(ORIGINALDATE))
$if($not(%originalyear%),$set(originalyear,%ORIGINALYEAR%)$delete(ORIGINALYEAR))
$if($not(%producer%),$set(producer,%PRODUCER%)$delete(PRODUCER))
$if($not(%releasecountry%),$set(releasecountry,%RELEASECOUNTRY%)$delete(RELEASECOUNTRY))
$if($not(%releasestatus%),$set(releasestatus,%RELEASESTATUS%)$delete(RELEASESTATUS))
$if($not(%releasetype%),$setmulti(releasetype,%RELEASETYPE%,;)$delete(RELEASETYPE))
$if($not(%totaltracks%),$set(totaltracks,%TOTALTRACKS%)$delete(TOTALTRACKS))
$if($not(%tracktotal%),$set(tracktotal,%TRACKTOTAL%)$delete(TRACKTOTAL))
and the same for WMA
# WMA to MP3
$if($not(%albumartistsort%),$set(albumartistsort,$get(WM/AlbumArtistSortOrder))$delete(WM/AlbumArtistSortOrder))
$if($not(%artistsort%),$set(artistsort,$get(WM/ArtistSortOrder))$delete(WM/ArtistSortOrder))
$if($not(%barcode%),$set(barcode,$get(WM/Barcode))$delete(WM/Barcode))
$if($not(%bpm%),$set(bpm,$get(WM/BeatsPerMinute))$delete(WM/BeatsPerMinute))
$if($not(%date%),$set(date,$get(WM/Year))$delete(WM/Year))
$if($not(%isrc%),$setmulti(isrc,$get(WM/ISRC),;)$delete(WM/ISRC))
$if($not(%key%),$set(key,$get(WM/InitialKey))$delete(WM/InitialKey))
$if($not(%media%),$set(media,$get(WM/Media))$delete(WM/Media))
$if($not(%musicbrainz_albumartistid%),$set(musicbrainz_albumartistid,$get(MusicBrainz/Album Artist Id))$delete(MusicBrainz/Album Artist Id))
$if($not(%musicbrainz_albumid%),$set(musicbrainz_albumid,$get(MusicBrainz/Album Id))$delete(MusicBrainz/Album Id))
$if($not(%musicbrainz_artistid%),$setmulti(musicbrainz_artistid,$get(MusicBrainz/Artist Id),;)$delete(MusicBrainz/Artist Id))
$if($not(%musicbrainz_releasegroupid%),$set(musicbrainz_releasegroupid,$get(MusicBrainz/Release Group Id))$delete(MusicBrainz/Release Group Id))
$if($not(%musicbrainz_trackid%),$set(musicbrainz_trackid,$get(MusicBrainz/Release Track Id))$delete(MusicBrainz/Release Track Id))
$if($not(%musicbrainz_recordingid%),$set(musicbrainz_recordingid,$get(MusicBrainz/Track Id))$delete(MusicBrainz/Track Id))
$if($not(%originalyear%),$set(originalyear,$get(WM/OriginalReleaseYear))$delete(WM/OriginalReleaseYear))
$if($not(%originaldate%),$set(originaldate,$get(WM/OriginalReleaseTime))$delete(WM/OriginalReleaseTime))
$if($not(%releasecountry%),$set(releasecountry,$get(MusicBrainz/Album Release Country))$delete(MusicBrainz/Album Release Country))
$if($not(%releasestatus%),$set(releasestatus,$get(MusicBrainz/Album Status))$delete(MusicBrainz/Album Status))
$if($not(%releasetype%),$setmulti(releasetype,$get(MusicBrainz/Album Type),;)$delete(MusicBrainz/Album Type))
$if($not(%script%),$set(script,$get(WM/Script))$delete(WM/Script))