-
-
Notifications
You must be signed in to change notification settings - Fork 419
PICARD-3029: Incorrect mapping of case-variant tags in MP4 files #2624
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
Conversation
<eading to data being persistent or being duplicated. In my fix, casemap is checked before the pre-mappings, avoiding the wrong behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the bugfix. This looks sensible and should work.
But I'd like to test this some more and make sure the change does not have other side effects. Changing the order of tag processing could easily break some other case.
I'm currently low on time, hence it will take a couple of days until I get to testing this change fully.
Sure! Let me know if I can help with anything. I'll also keep testing to check if there are any case where the processing might break. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. I checked this, and I can't see that it would break anything. General change is good o go, I just have two minor stylistic comments.
And sorry for the longer delay, last two weeks didn't exactly turn out as expected for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks a lot. LGTM
As a side note I wonder whether we need something similar for ID3. I haven't checked the code yet, but it might have the same issue.
Thanks! I'm not sure if it happens in ID3 as well, I haven’t looked at the ID3 code yet, but I might take a look when I get some time. |
Fix #3029: incorrect mapping of case-variant tags in MP4 files <eading to data being persistent or being duplicated. In my fix, casemap is checked before the pre-mappings, avoiding the wrong behaviour.
Summary
This is a…
Description (1-2 sentences):
A change has been applied to
mp4.py
, ensuring that_casemap
is checked before applying pre-mappings. This prevents duplicate tags from being saved in the file.Problem
Although
_casemap
correctly stores the capitalization of a tag when loading, an issue arises if a stored tag (e.g.,----:com.apple.iTunes:Label
) shares the same internal Picard tag as one of the pre-mapped cases (e.g.,label
). In such cases, the internal tag would be converted to the pre-mapped format (e.g.,----:com.apple.iTunes:LABEL
) when saving. This leads to duplicate tags in the saved file.Solution
The fix prioritizes maintaining the original tag capitalization. When saving or deleting a tag,
_casemap
is checked before applying the pre-mapped cases.Action
Additional actions required: