Skip to content
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

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

Closed
lazka opened this issue Jul 4, 2014 · 2 comments
Closed

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

lazka opened this issue Jul 4, 2014 · 2 comments
Labels

Comments

@lazka
Copy link
Member

@lazka lazka commented Jul 4, 2014

Originally reported by: Christoph Reiter (Bitbucket: lazka, GitHub: lazka)


From evol...@evolui.org on December 05, 2013 19:09:48

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!

Attachment: mp4.py.diff

Original issue: http://code.google.com/p/mutagen/issues/detail?id=165


@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From reiter.christoph@gmail.com on December 05, 2013 13:15:25

Thanks. Can you send me the mp4 file somehow (email/dropbox/etc...)?

Status: NeedInfo

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Sep 29, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


mp4: keep all atoms with the same name, not just the last one. (Fixes issue #165)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.