mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 15:04:08 +02:00
When searching allow use of uppercase locations
When searching allow use of uppercase location names, such as AUTHOR instead of author, automatically lowercasing them. Fixes #1192785 [search errors are replicated automatically](https://bugs.launchpad.net/calibre/+bug/1192785)
This commit is contained in:
parent
e533d7d218
commit
91b9bc6f0d
1 changed files with 2 additions and 2 deletions
|
|
@ -240,8 +240,8 @@ def base_token(self):
|
|||
# the search string is something like 'author: "foo"' because it
|
||||
# will be interpreted as 'author:"foo"'. I am choosing to accept the
|
||||
# possible error. The expression should be written '"author:" foo'
|
||||
if len(words) > 1 and words[0] in self.locations:
|
||||
loc = words[0]
|
||||
if len(words) > 1 and words[0].lower() in self.locations:
|
||||
loc = words[0].lower()
|
||||
words = words[1:]
|
||||
if len(words) == 1 and self.token_type() == self.QUOTED_WORD:
|
||||
return ['token', loc, self.token(advance=True)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue