Skip to content

ftintitle: fix mid-string feat brackets, artist_sort truncation and credits lost to custom title words - #7101

Open
najchris11 wants to merge 5 commits into
beetbox:masterfrom
najchris11:fix/ftintitle-feat-splitting
Open

najchris11 wants to merge 5 commits into
beetbox:masterfrom
najchris11:fix/ftintitle-feat-splitting

Conversation

@najchris11

@najchris11 najchris11 commented Oct 13, 2026 •

Copy link
Copy Markdown

Summary

Fixes #7100. Corrects three ftintitle cases that corrupt or lose artist credits:

Artist (feat. B) & C / Song
  → Artist & C / Song (feat. B)
The Weeknd feat. X / Song, sort Weeknd, The
  → The Weeknd / Song (feat. X), sort Weeknd, The
Keith Sweat feat. Ronald Isley / Come With Me, custom_words: [with]
  → Keith Sweat / Come With Me (feat. Ronald Isley)

Bracket matching preserves artist text following a featured credit and leaves malformed brackets unsplit. Sort names lose only explicit standard featuring markers, preserving commas and generic/custom separators. Custom words in titles count as credits inside parentheses or square brackets; ordinary titles such as Come With Me no longer swallow the featured artist.

Unless drop is enabled, a credit stays in the artist field if the title cannot carry it and has no matching credit. Existing keep_in_artist behavior and preserve_album_artist semantics are preserved. Repairing previously damaged tags is outside scope.

Includes regression tests for nested, attached and malformed brackets; albumartist extraction; sort punctuation; custom words; existing title credits; and format arguments, plus plugin documentation and three changelog entries.

Evidence

  • Before: Issue ftintitle: mid-string feat brackets leave "Artist (", artist_sort loses ", The", and custom words in titles drop the featured artist #7100 provides an in-memory reproduction on 2.14.1 and master 18967aad9: mid-string brackets become dangling brackets, Weeknd, The is truncated, and the Keith Sweat credit disappears from both fields.
  • After (fresh local checks on Python 3.12.15, current master lockfile): test/plugins/test_ftintitle.py and test/test_plugins.py: 241 passed, 79 skipped for optional dependencies, including all 222 ftintitle cases.
  • Ruff formatting (311 files), lint on the changed Python files, repository RST lint, whole-docs formatting, and strict Sphinx HTML build (--fail-on-warning --keep-going): pass.
  • Full pytest: 2,954 passed, 123 skipped, 11 xfailed, 75 failed. Failures are outside ftintitle and cluster in BPD socket/server tests, color output, fetchart color, and thumbnails. Representative failures from each cluster also fail on clean ab4bdfd5d; the local sandbox blocks sockets, sets NO_COLOR=1, and makes home caches read-only. This local run is not a full-suite pass.
  • CI-style repository mypy reports an ast.FunctionDef overload error at beets/util/functemplate.py:102; the same error reproduces on clean ab4bdfd5d. This is not a passing type check.
  • Final diff acceptance check: all five code requirements passed. The optional automatic Gemini review timed out; it provided no code-review verdict.
  • Rebased onto ab4bdfd5d. Resolved the changelog conflict by retaining upstream additions and all three ftintitle entries. Plugin implementation, tests and plugin documentation are unchanged from the original PR head 1bda97875.
  • Fresh GitHub CI results for the updated head are pending; earlier CI results apply to the previous head.

Merge Danger

Door: Two-way for the code change. Running beet ftintitle writes metadata; reverting code does not restore tags already rewritten.

Blast Radius: ftintitle

Behavior changes for users relying on unbracketed custom title words: Come With Me no longer counts as an existing featured-artist credit. This is documented.

I used AI assistance while writing this change. I've reviewed and understand the patch, and I'll handle the review discussion myself.

@najchris11
najchris11 requested a review from a team as a code owner October 13, 2026 02:07
Copilot AI balanced review requested due to automatic review settings October 13, 2026 02:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the ftintitle ftintitle plugin label Oct 13, 2026
@najchris11
najchris11 requested a balanced review from Copilot October 13, 2026 02:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.94%. Comparing base (03c1946) to head (013b2e3).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7101      +/-   ##
==========================================
+ Coverage   80.87%   80.94%   +0.07%     
==========================================
  Files         150      150              
  Lines       21244    21327      +83     
  Branches     3245     3272      +27     
==========================================
+ Hits        17181    17264      +83     
- Misses       3249     3250       +1     
+ Partials      814      813       -1     
Files with missing lines Coverage Δ
beetsplug/ftintitle.py 96.35% <100.00%> (+3.06%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@najchris11
najchris11 requested a balanced review from Copilot October 13, 2026 16:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@najchris11
najchris11 force-pushed the fix/ftintitle-feat-splitting branch from 1bda978 to d26f0c1 Compare October 29, 2026 18:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ftintitle ftintitle plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ftintitle: mid-string feat brackets leave "Artist (", artist_sort loses ", The", and custom words in titles drop the featured artist

2 participants