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 import title_sort, author_to_author_sort
|
||||||
from calibre.ebooks.metadata.opf2 import metadata_to_opf
|
from calibre.ebooks.metadata.opf2 import metadata_to_opf
|
||||||
from calibre import prints
|
from calibre import prints
|
||||||
|
from calibre.utils.icu import primary_find
|
||||||
|
|
||||||
class MetadataBackup(Thread): # {{{
|
class MetadataBackup(Thread): # {{{
|
||||||
'''
|
'''
|
||||||
@ -147,9 +148,10 @@ def _match(query, value, matchkind):
|
|||||||
return True
|
return True
|
||||||
elif query == t:
|
elif query == t:
|
||||||
return True
|
return True
|
||||||
elif ((matchkind == REGEXP_MATCH and re.search(query, t, re.I|re.UNICODE)) or ### search unanchored
|
elif matchkind == REGEXP_MATCH:
|
||||||
(matchkind == CONTAINS_MATCH and query in t)):
|
return re.search(query, t, re.I|re.UNICODE)
|
||||||
return True
|
elif matchkind == CONTAINS_MATCH:
|
||||||
|
return primary_find(query, t)[0] != -1
|
||||||
except re.error:
|
except re.error:
|
||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user