From 1038b5124ac6c50fbc69099b5c9a6de3ad6c7e13 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Fri, 16 Apr 2021 08:54:57 +0100 Subject: [PATCH] Bug #1924675: Set/unset on 'rating' invalid --- src/calibre/library/coloring.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/library/coloring.py b/src/calibre/library/coloring.py index 6f98352928..476429549c 100644 --- a/src/calibre/library/coloring.py +++ b/src/calibre/library/coloring.py @@ -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', '', ''),