mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix search() behavior again
This commit is contained in:
parent
786ab0ef80
commit
c0fbc32e4c
@ -628,14 +628,13 @@ class ResultCache(SearchQueryParser):
|
|||||||
|
|
||||||
def search(self, query, return_matches=False,
|
def search(self, query, return_matches=False,
|
||||||
ignore_search_restriction=False):
|
ignore_search_restriction=False):
|
||||||
if not query or not query.strip():
|
|
||||||
q = ''
|
q = ''
|
||||||
|
if not query or not query.strip():
|
||||||
if not ignore_search_restriction:
|
if not ignore_search_restriction:
|
||||||
q = self.search_restriction
|
q = self.search_restriction
|
||||||
else:
|
else:
|
||||||
if ignore_search_restriction:
|
q = query
|
||||||
q = u'%s' % query
|
if not ignore_search_restriction:
|
||||||
else:
|
|
||||||
q = u'%s (%s)' % (self.search_restriction, query)
|
q = u'%s (%s)' % (self.search_restriction, query)
|
||||||
if not q:
|
if not q:
|
||||||
if return_matches:
|
if return_matches:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user