mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Searching on the size column
This commit is contained in:
commit
985cbb78e3
@ -341,8 +341,15 @@ class ResultCache(SearchQueryParser):
|
||||
cast = lambda x : float (x)
|
||||
adjust = lambda x: x
|
||||
|
||||
if len(query) > 1:
|
||||
mult = query[-1:].lower()
|
||||
mult = {'k':1024.,'m': 1024.**2, 'g': 1024.**3}.get(mult, 1.0)
|
||||
if mult != 1.0:
|
||||
query = query[:-1]
|
||||
else:
|
||||
mult = 1.0
|
||||
try:
|
||||
q = cast(query)
|
||||
q = cast(query) * mult
|
||||
except:
|
||||
return matches
|
||||
|
||||
|
@ -253,7 +253,7 @@ class FieldMetadata(dict):
|
||||
'is_multiple':None,
|
||||
'kind':'field',
|
||||
'name':None,
|
||||
'search_terms':[],
|
||||
'search_terms':['size'],
|
||||
'is_custom':False,
|
||||
'is_category':False}),
|
||||
('timestamp', {'table':None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user