mirror of
https://github.com/beetbox/beets.git
synced 2025-12-30 20:42:37 +01:00
fuzzy: Fix #1422, regression crasher
This commit is contained in:
parent
46f382fd9b
commit
b313c8b46a
2 changed files with 4 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ from __future__ import (division, absolute_import, print_function,
|
|||
|
||||
from beets.plugins import BeetsPlugin
|
||||
from beets.dbcore.query import StringFieldQuery
|
||||
from beets import config
|
||||
import difflib
|
||||
|
||||
|
||||
|
|
@ -30,7 +31,7 @@ class FuzzyQuery(StringFieldQuery):
|
|||
if pattern.islower():
|
||||
val = val.lower()
|
||||
queryMatcher = difflib.SequenceMatcher(None, pattern, val)
|
||||
threshold = self.config['threshold'].as_number()
|
||||
threshold = config['fuzzy']['threshold'].as_number()
|
||||
return queryMatcher.quick_ratio() >= threshold
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ Little fixes and improvements:
|
|||
with Discogs on setup. :bug:`1417`
|
||||
* :doc:`/plugins/importadded`: Fix a crash when importing singletons in-place.
|
||||
:bug:`1416`
|
||||
* :doc:`/plugins/fuzzy`: Fix a regression causing a crash in the last release.
|
||||
:bug:`1422`
|
||||
|
||||
1.3.11 (April 5, 2015)
|
||||
----------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue