View Single Post
Old 04-26-2015, 05:55 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
@chaley - how about an option (--rules) be added to the calibredb custom_columns command to list columns used as colour/icon target, or a within a colour/icon rule?

BR
Such a thing is possible, albeit difficult because of advanced rules. However, I am not sure what problem it would solve. What you would get is a list of columns, not the contexts (rule/condition) in which they are evaluated. You can see this in an easier-to-view setting (again, ignoring advanced rules) in the various preferences screens. You can see the complete underlying template in metadata_db_prefs_backup.json. And unfortunately none of these solve Tanjamuse's problem: what rules were made invalid by the type change.

The problem arises when the column behind a lookup key changes type, something that can happen only when a column is deleted then a new column with a different type but with the same lookup key is added. In most cases, when this happens any rule with a condition making reference to that column must change because the semantics of the conditions change. Having the column names doesn't tell the user enough about that problem to find the offending conditions.

I have submitted a change to Kovid to show invalid conditions in the preferences rules display panels, making it easier to find rules that use columns that changed types. This along with a change Kovid made to prevent tossing exceptions when invalid rules are encountered should permit the user to find and fix problems without encountering calibre misbehavior.
chaley is offline   Reply With Quote