<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Hello,<div><br></div><div>I&#39;m currently using the rtaglib Ruby bindings for TagLib. Working with FLAC files, when I try to add more than one of the same field, everything appears to be working fine until I try to save the changes. However, once I run the save() method on the TagLib file object, only the first value for the field is actually saved.</div>
<div><br></div><div>Interesting things I&#39;ve noticed:</div><div>- After running save(), the fieldListMap has a null COMMENT field.</div><div>- If I actually add a COMMENT field, the fieldListMap has a null DESCRIPTION field.</div>
<div>- Multiple values for the same field are working fine with custom fields, but not DATE, ARTIST, TRACKNUMBER, etc.</div><div>- Everything seems to be working fine with Vorbis files; I&#39;m using the exact same method for FLAC and Vorbis files in my script.</div>
<div><br></div><div>I&#39;ve added output to my script to show this strange behaviour, and ran commands on both FLAC and Vorbis files to show it in action.</div><div><a href="http://paste.pocoo.org/show/276817/" target="_blank" style="color: rgb(0, 0, 204); ">http://paste.pocoo.org/show/276817/</a></div>
<div><a href="http://dpaste.com/259444/" target="_blank" style="color: rgb(0, 0, 204); ">http://dpaste.com/259444/</a>  (mirror)</div><div><br></div><div>The code I&#39;m using to add a field:</div><div>    field = TagLib::String.new(field)</div>
<div><div>    metadata.addField(field, TagLib::String.new(value), false)</div><div>Each line in the pasted output is generated from:</div><div>    metadata.fieldListMap.hash</div><div><br></div><div>Note that &quot;metadata&quot; above is not a variable, it&#39;s a function which returns @file.xiphComment for FLAC files and @file.tag for Vorbis files, with @file being either a TagLib::FLAC::File object or a TagLib::Vorbis::File object. (Ruby doesn&#39;t require explicit () on method calls with no arguments.)</div>
<div><br></div><div>I&#39;m not sure what could be causing this; I&#39;m assuming either TagLib or rtaglib is doing something strange... I don&#39;t have the C++ knowledge to easily test this out with TagLib directly, so I figured I&#39;d post it here in case anybody knows what the reason behind this could be. Otherwise, I guess I&#39;ll spend the hour or so writing C++ to test it.</div>
</div><div><br></div><div>Thanks. :)</div></span>