Commits

phmongeau  committed af7fa25

fuzzy: use smartcase for the pattern

ignore case unless the pattern contains a capital letter

  • Participants
  • Parent commits c6346bb

Comments (0)

Files changed (1)

File beetsplug/fuzzy.py

         if pattern is None:
             return False
         val = util.as_string(val)
+        # smartcase
+        if(pattern.islower()):
+            val = val.lower()
         queryMatcher = difflib.SequenceMatcher(None, pattern, val)
-        return queryMatcher.quick_ratio() > self.threshold
+        return queryMatcher.quick_ratio() >= self.threshold
 
 
 class FuzzyPlugin(BeetsPlugin):