-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metaflac bug - error writing multi-line tag from stdin #232
Comments
There's currently no workaround using metaflac, even writing multi-line tags to a temp file Please could you either implement --remove-all-tags-except or improve metaflac by enabling multi-line tags to be written from file and/or stdin. |
Hi FLAC-gurus, Thought I'd add my findings to support future users puzzled by this issue, as I too encountered this issue during (I've attempted to batch-upgrade FLAC-files in-place, but that fails sometimes (ex. caused by ID3-tag), so I fall-back on re-encode & re-tagging instead ~ hence encountering the multi-line issue during import of exported tags) WorkaroundThe (In my case I now combine re-encode and re-tagging into a single command by splitting the exported tags into separate files and arguments ~ short-circuiting my previous re-tagging approach based on A plea for flac/metaflac multi-line tag feature parityThe
The reasoning behind the above approach is discussed further here. |
Seeing as there's no option within metaflac to --remove-all-tags-except, in an effort to achieve consistency in tagging I devised a workaround that writes tags to be preserved to stdout and pipes same to another call to metaflac which deletes all tags and then writes back input from stdin.
The general form would be:
metaflac --show-tag tagname1 --show-tag tagname2 --show-tag tagnamex "filename.flac" | metaflac --preserve-modtime --remove-all-tags --import-tags-from=- "filename.flac"
However, I've come up against an issue, as the following call demonstrates:
metaflac --show-tag lyrics x.flac | metaflac --import-tags-from=- x.flac
Running the above should result in the corresponding vorbiscomment simply being rewritten, and it works as intended until it encounters a tag with a CR or LF within the tag, meaning it will not work for the likes of a Lyrics tag, rendering the workaround fruitless.
To illustrate:
metaflac --list x.flac
As soon as there's a CR or LF in a comment, such as in the example above, metaflac fails with the following:
Is there something more I can do my side to work around this or does this now mean there's no solution until this bug is addressed or something like --remove-all-tags-except is implemented?
The text was updated successfully, but these errors were encountered: