mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Bug #1924675: Set/unset on 'rating' invalid
This commit is contained in:
parent
38099ab36f
commit
1038b5124a
@ -144,6 +144,10 @@ class Rule(object): # {{{
|
||||
return "cmp(raw_field('%s'), %s, '%s', '%s', '%s')" % (col, val, lt, eq, gt)
|
||||
|
||||
def rating_condition(self, col, action, val):
|
||||
if action == 'is set':
|
||||
return "test(field('%s'), '1', '')"%col
|
||||
if action == 'is not set':
|
||||
return "test(field('%s'), '', '1')"%col
|
||||
lt, eq, gt = {
|
||||
'eq': ('', '1', ''),
|
||||
'lt': ('1', '', ''),
|
||||
|
Loading…
x
Reference in New Issue
Block a user