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

[BUG] Ncmpcpp duplicates tags. #371

Closed
TriaSirax opened this issue Jan 11, 2020 · 2 comments · Fixed by #373
Closed

[BUG] Ncmpcpp duplicates tags. #371

TriaSirax opened this issue Jan 11, 2020 · 2 comments · Fixed by #373

Comments

@TriaSirax
Copy link

@TriaSirax TriaSirax commented Jan 11, 2020

When I try to delete or edit a tag in tag editor, it won't overwrite the tag. Instead it appends whatever I typed to the existing tag with pipe "|" symbol in between. When I tried to delete a tag completely
it appends itself this time. It doesn't matter which tag I edit. Even though I edit only one tag this weird bug happens to all of them. Now my tags look like this:
1979 | 1979 | 1979 | 1979
Highway to Hell | Highway to Hell | Highway to Hell | Highway to Hell
AC/DC | AC/DC | AC/DC | AC/DC
.
.
.

When I try to get information through mpc everything seems fine. So the bug is caused by ncmpcpp.

@wylfen

This comment has been minimized.

Copy link
Contributor

@wylfen wylfen commented Jan 11, 2020

I am running into this as well, and investigated more thoroughly today.

First of all, this will not happen on distributions/platforms that use the last stable release taglib-1.11.1. For me on Gentoo, the latest packaged version is taglib at taglib/taglib@54508df.

The issue is how taglib's removeField method works differently, introduced in taglib/taglib@c05fa78#diff-b48915d5a31d8a598dc1f3e92810bbd1L189.

There, value was changed from defaulting to String::null to String(), meaning that the default is now an empty string and not a null value. This means that removeField(type) will now attempt to remove a tag matching the empty string.

As discussed on taglib's side in taglib/taglib#651 this should possibly not have happened. Note here that removeField has been marked as deprecated since at least 2015, and ncmpcpp probably should not have been using it.

The correct method to use now is removeFields(type). It would also be possible to simply pass true instead of false with tag->addField(type, *it, false); in src/tags.cpp.

I currently do not have the time to open a pull request, but will do so later today if it's not been fixed by then.

@TriaSirax

This comment has been minimized.

Copy link
Author

@TriaSirax TriaSirax commented Jan 11, 2020

Thank you for your detailed answer. I'm also on gentoo (a newbie though). And I was not having this issue a month or two ago. Now I checked and dates are matching, they dropped 1.11.1_p20181028 and moved to 1.11p20190920-r1. So for now I'll go back to previous version. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.