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

ftintitle duplicates feature part if in parentheses #5436

Closed
klb2 opened this issue Sep 22, 2024 · 1 comment · Fixed by #5437
Closed

ftintitle duplicates feature part if in parentheses #5436

klb2 opened this issue Sep 22, 2024 · 1 comment · Fixed by #5437

Comments

@klb2
Copy link
Contributor

klb2 commented Sep 22, 2024

Problem

When running beet ftintitle multiple times, the feature X part gets repeated, if the feature X part is in parentheses.

$ beet ftintitle
ftintitle: /Music/01 Title (feat. Second Artist).flac
ftintitle: artist: First Artist feat. Second Artist (Not changing due to keep_in_artist)
ftintitle: title: Title (feat. Second Artist) -> Title (feat. Second Artist) (feat. Second Artist)

Reason

The ftintitle.contains_feat function uses the regular expression feat_tokens from beets/plugins.py to match existing feat. X parts. However, the current regex does only match feat. X parts when they are preceded by a space (not parentheses).

>>> from beetsplug import ftintitle
>>> ftintitle.contains_feat("Title (feat. Second Artist)")
False
>>> ftintitle.contains_feat("Title feat. Second Artist")
True

Setup

  • OS: Linux
  • Python version: 3.12
  • beets version: master branch @ cd360b6
@klb2
Copy link
Contributor Author

klb2 commented Sep 22, 2024

A simple solution would be to extend the regular expression in the feat_tokens function to include parentheses.

klb2 added a commit to klb2/beets that referenced this issue Sep 30, 2024
Add references to the ftintitle plugin for the bug fixes beetbox#5441 and beetbox#5436
that are related to this plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant