mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 22:14:07 +02:00
Make contains searches be more forgiving about accents.
This commit is contained in:
parent
0ef31b067c
commit
62d5c99297
1 changed files with 5 additions and 3 deletions
|
|
@ -20,6 +20,7 @@
|
|||
from calibre.ebooks.metadata import title_sort, author_to_author_sort
|
||||
from calibre.ebooks.metadata.opf2 import metadata_to_opf
|
||||
from calibre import prints
|
||||
from calibre.utils.icu import primary_find
|
||||
|
||||
class MetadataBackup(Thread): # {{{
|
||||
'''
|
||||
|
|
@ -147,9 +148,10 @@ def _match(query, value, matchkind):
|
|||
return True
|
||||
elif query == t:
|
||||
return True
|
||||
elif ((matchkind == REGEXP_MATCH and re.search(query, t, re.I|re.UNICODE)) or ### search unanchored
|
||||
(matchkind == CONTAINS_MATCH and query in t)):
|
||||
return True
|
||||
elif matchkind == REGEXP_MATCH:
|
||||
return re.search(query, t, re.I|re.UNICODE)
|
||||
elif matchkind == CONTAINS_MATCH:
|
||||
return primary_find(query, t)[0] != -1
|
||||
except re.error:
|
||||
pass
|
||||
return False
|
||||
|
|
|
|||
Loading…
Reference in a new issue