robinbowes / flac2mp3

flac2mp3 is a tool to convert audio files from flac to mp3 format including the copying of tags.
GNU General Public License v3.0
143 stars 29 forks source link

Tag conflict causes tags to always be rewritten #43

Open djjeck opened 9 years ago

djjeck commented 9 years ago

I noticed that when ALBUMARTIST tag is set, but not BAND, since they are both mapped to the same key (TPE2), they overwrite each other, causing the tag matching to fail and the tags to be rewritten on subsequent re-runs. This is not always the case, but it looks like it happens with 50% probability. It looks like no precedence is declared between the two, so I guess it depends on how python iterates the map structures involved. (A similar thing happens for the COMMENT tag, but I believe it happens because of a multiple comment field that I will manually fix. This is much rarer, just one album on my collection. I'm not sure the file is well-formed, so I won't open another ticket)

Workaround: get rid of the BAND tag. I actually remember that ALBUMARTIST was commented out some time ago, possibly for this reason. But if one needs to go, I'd take BAND out. Replacing

'BAND'                    => 'TPE2',

with

'BAND'                    => 'TXXX',

stops the tag rewrites from happening.

I will try to implement a better fix, with no indeterminacy nor information loss involved, and update this thread.

andynormancx commented 9 years ago

Did you come up with a better fix ? I've just run into this issue.

TheGoblinHero commented 8 years ago

Fix works. Thx!

trip5 commented 4 years ago

Yeah I just commented out that line completely. I've never seen a BAND tag used anyway.