Fix case-sensitive comparison in compare_strings fuzzy matching (#3151)
authorDavid Bishop <teancom@users.noreply.github.com>
Fri, 13 Feb 2026 09:33:02 +0000 (01:33 -0800)
committerGitHub <noreply@github.com>
Fri, 13 Feb 2026 09:33:02 +0000 (10:33 +0100)
commit17114546c74d268b40e295edd1cb4482eea28a8f
treefdb6c50378ab00c4aced9e1770b8f89fe2cf8458
parentac42188601a174097f72611a1c0b672e8b716f76
Fix case-sensitive comparison in compare_strings fuzzy matching (#3151)

In non-strict mode, compare_strings lowercases str1 but passes the
original-case str2 to SequenceMatcher on line 564. This causes fuzzy
matching to penalize case differences, making it fail to match strings
like "Track Feat. John" vs "TRACK FT. JOHN" that should be considered
equivalent.

Also fix the elif branch (line 559) to replace on str2_lower instead
of str2, so the result is consistently lowered.

Co-authored-by: David Bishop <git@gnuconsulting.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
music_assistant/helpers/compare.py
tests/core/test_compare.py