You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ftintitle plugin has the contains_feat function to check whether a given title already contains a "feat. X" part. The regex used for pattern matching is defined in the feat_tokens function in beets/plugins.py.
In the default call of feat_tokens(), this adds possible feat_words like "and" and "with". This can yield to false positives in the feature detection as shown in the following example:
>>>frombeetsplugimportftintitle>>>ftintitle.contains_feat("Live and Let Go")
True
However, this is simply the title of the song and does not contain a "feat. X" part. (The "and" in the title is detected and matched in the regex.)
The consequence of this is that the ftintitle plugin will actually not add the actual "feat. X" part to the title as it thinks it already contains one.
Fix
I believe the issue is that in ftintitle.contains_feat, the regex is constructed using plugins.feat_tokens(), which sets for_artist=True. A fix would be to change this to plugins.feat_tokens(for_artist=False) as we are matching song titles and not artist.
Fixes#5441
This small change explicitly passes the `for_artist` keyword to the
`plugins.feat_tokens` function that constructs the regex for matching
existing "feat. X" parts in song titles.
Previously, it was not passed and set to the default (`True`), which
caused using the pattern intended for the artist field to also be used
for the title field.
This caused some false positives as shown in #5441
Problem
The
ftintitle
plugin has thecontains_feat
function to check whether a given title already contains a "feat. X" part. The regex used for pattern matching is defined in thefeat_tokens
function inbeets/plugins.py
.In the default call of
feat_tokens()
, this adds possiblefeat_words
like "and" and "with". This can yield to false positives in the feature detection as shown in the following example:However, this is simply the title of the song and does not contain a "feat. X" part. (The "and" in the title is detected and matched in the regex.)
The consequence of this is that the
ftintitle
plugin will actually not add the actual "feat. X" part to the title as it thinks it already contains one.Fix
I believe the issue is that in
ftintitle.contains_feat
, the regex is constructed usingplugins.feat_tokens()
, which setsfor_artist=True
. A fix would be to change this toplugins.feat_tokens(for_artist=False)
as we are matching song titles and not artist.Setup
master
branch @ 1a59368The text was updated successfully, but these errors were encountered: