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

Add detection of "feat. X" parts in parentheses; Fix #5436 #5437

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

klb2
Copy link
Contributor

@klb2 klb2 commented Sep 22, 2024

Description

Fixes #5436

The ftintitle.contains_feat function uses the regular expression feat_tokens from beets/plugins.py to match existing feat. X parts. In the old version, the regex only matched "feat. X" parts when they are preceded by a space.

This update adds matching "feat. X" parts in parentheses and brackets.

To Do

  • Documentation.
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests.

When checking whether a title or artist contains a feature, it now also
detects them when they are in parentheses or brackets, i.e., "Song Name
(feat. XYZ)" will return true.
The previous version of the `plugins.feat_tokens` regular expression
only matched "feat. X" parts if preceded by a space. This caused missed
detections in the `ftintitle.contains_feat` function.
This commit adds unit tests for the updated regex that also matches
"feat. X" parts within parentheses and brackets
Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

Copy link
Member

@JOJ0 JOJ0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Thanks for this fix! LGTM. Please add a short changelog entry and we merge it.

beets/plugins.py Outdated Show resolved Hide resolved
@klb2
Copy link
Contributor Author

klb2 commented Sep 23, 2024

Nice one! Thanks for this fix! LGTM. Please add a short changelog entry and we merge it.

Thanks! I have fixed the unnecessary comma in the regex and added a changelog entry.

@klb2 klb2 requested a review from JOJ0 September 23, 2024 16:33
@JOJ0 JOJ0 merged commit 1a59368 into beetbox:master Sep 23, 2024
12 checks passed
@klb2 klb2 deleted the more_feat_delimiters branch September 23, 2024 20:59
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 this pull request may close these issues.

ftintitle duplicates feature part if in parentheses
2 participants