mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Make contains searches be more forgiving about accents.
This commit is contained in:
parent
0ef31b067c
commit
62d5c99297
@ -20,6 +20,7 @@ from calibre.utils.localization import (canonicalize_lang, lang_map, get_udc,
|
||||
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…
x
Reference in New Issue
Block a user