vahgar / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
0 stars 0 forks source link

Only last value is returned for iTunes atoms with multiple values #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I noticed that my '\xa9grp' tag in MusicBee has multiple tag values (i.e. 
"Rock; Indie; Punk; Pop"), but mutagen only returns [u'Pop'].  This is true for 
other atoms that have multiple values such as mood, occasion, etc...

Looking at the binary m4p/m4a files, the atom name is listed for each value 
(like such):

  \xa9grp : Rock
  \xa9grp : Indie
  \xa9grp : Punk
  \xa9grp : Pop

Each time mutagen encounters the atom name (i.e. \xa9grp), it overwrites the 
previous value for that same name, so that only the last value is remembered.

The correct behavior should be for mutagen to accumulate values that have the 
same atom names.  Attached is a patch that works for me for iTunes files 
(mp4.py).  It overrides __setitem__ in the MP4Tags class to extend the value 
list if it already exists for an atom rather than replace it.

However, this was more or less a hack to get things working for my situation.  
It is likely that other metadata formats need to consider this same fix (for 
example, I don't have this issue with MP3's, but that may be a unique case).  

Sorry I'm not fluent at hg or patching, so this was the best I could do to 
elevate the issue and provide a suggested solution.

Thanks for all the work on mutagen!

Original issue reported on code.google.com by evol...@evolui.org on 5 Dec 2013 at 6:09

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. Can you send me the mp4 file somehow (email/dropbox/etc...)?

Original comment by reiter.christoph@gmail.com on 5 Dec 2013 at 9:15

GoogleCodeExporter commented 9 years ago
mutagen has moved to Bitbucket: https://bitbucket.org/lazka/mutagen/issue/165

Original comment by reiter.christoph@gmail.com on 4 Jul 2014 at 3:35