-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
PICARD-2468: Properly handle unspecified languages in ID3v2 comments #2370
Conversation
3fa54ae
to
aa97734
Compare
Thanks a lot for this. I think as a workaround this probably makes sense and we could include it even in the next Picard 2.x release. Essentially this is issue happens because the language notation got introduced as an afterthought (4d85c2e). Similar issues plague the still open PR #1650 for doing the same to the lyrics tag. I guess we should reconsider this and make a harder cut for Picard 3, making the language not optional. I' thinking of having both colons be present even if language is empty, such as |
Yes, I agree. |
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.
Ok, let's go with this. The code itself is good to go. Please only add a test for this case to https://github.com/metabrainz/picard/blob/master/test/test_util_tags.py#L37
Also please rebase this branch. CI is currently failing due to changes to the Github Action Windows image, and this has been fixed on the master branch.
Previously, a `COMM` frame with `lang='XXX' desc=''` would be saved as a separate frame with `lang='eng' desc='XXX'`. Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
aa97734
to
0436b7a
Compare
Hey @phw is there anything else I need to do for this? |
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.
@Serial-ATA I think no, I just could not get back to this earlier.
From my side I'd say we merge this as it is. It fixes the common issue while being fully backward compatible. We can also merge it then into the 2.x branch for a future release of Picard 2.
I still think we should rework this to completely eliminate the ambiguity. I added PICARD-2844 for that.
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.
LGTM
Summary
Picard no longer creates a duplicate
COMM
frame with the incorrect language when usinglang='XXX' + desc=''
.Problem
Previously, a
COMM
frame withlang='XXX' desc=''
would be saved as a separate frame withlang='eng' desc='XXX'
. This is due to Picard supporting bothcomment:desc
andcomment:lang:desc
syntax for comment tags.Solution
A special case was added for
lang='XXX', desc=''
. I could not think of a better solution for the problem, as Picard normalizes all metadata keys. It would be more elegant if trailing colons were preserved.Action
Possibly explore storing these comments as
comment:XXX:
, leaving the trailing colon as a marker for an empty description. This solution is not perfect. In the event that someone hascomment:eng:XXX
, alleng
comments are simply stored ascomment:desc
. With this change, their language would be overwritten withXXX
.