mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
Fixes #1924675 [Rules editors: Set/unset on 'rating' invalid](https://bugs.launchpad.net/calibre/+bug/1924675)
This commit is contained in:
commit
39b3e36e20
@ -144,6 +144,10 @@ class Rule(object): # {{{
|
|||||||
return "cmp(raw_field('%s'), %s, '%s', '%s', '%s')" % (col, val, lt, eq, gt)
|
return "cmp(raw_field('%s'), %s, '%s', '%s', '%s')" % (col, val, lt, eq, gt)
|
||||||
|
|
||||||
def rating_condition(self, col, action, val):
|
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 = {
|
lt, eq, gt = {
|
||||||
'eq': ('', '1', ''),
|
'eq': ('', '1', ''),
|
||||||
'lt': ('1', '', ''),
|
'lt': ('1', '', ''),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user