Skip to content

fix(playlist): match NFC and NFD Unicode paths in PlaylistQuery - #7186

Open
boomesh11 wants to merge 1 commit into
beetbox:masterfrom
boomesh11:fix/playlist-unicode-normalization
Open

boomesh11 wants to merge 1 commit into
beetbox:masterfrom
boomesh11:fix/playlist-unicode-normalization

Conversation

@boomesh11

Copy link
Copy Markdown
Contributor

Summary

  • Fixes playlist: Address Unicode normalization differences when constructing queries #4739
  • When playlist entries use NFC-normalized UTF-8 paths while the database stores NFD-normalized paths (e.g., on macOS APFS/HFS+), PlaylistQuery previously missed matches because InQuery performs exact byte-level comparison.
  • Include distinct NFC and NFD UTF-8 normalized byte variants alongside the original normpath result in PlaylistQuery.__init__.

Testing

  • Added PlaylistUnicodeNormalizationTest.test_query_matches_nfc_and_nfd_paths in test/plugins/test_playlist.py.
  • Verified uv run pytest test/plugins/test_playlist.py (21/21 passed), ruff check, and mypy.

@boomesh11
boomesh11 requested a review from a team as a code owner November 16, 2026 07:37
@github-actions

Copy link
Copy Markdown

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.

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.84%. Comparing base (ee6e08a) to head (1e9163b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
beetsplug/playlist.py 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7186      +/-   ##
==========================================
- Coverage   81.02%   80.84%   -0.19%     
==========================================
  Files         150      150              
  Lines       21228    21238      +10     
  Branches     3242     3244       +2     
==========================================
- Hits        17201    17169      -32     
- Misses       3212     3254      +42     
  Partials      815      815              
Files with missing lines Coverage Δ
beetsplug/playlist.py 86.88% <81.81%> (-0.62%) ⬇️

... and 3 files 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.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

playlist: Address Unicode normalization differences when constructing queries

1 participant