From 8980eaf21b478915c12dafe149f5f33117321140 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Fri, 21 Feb 2014 19:07:32 -0600 Subject: [PATCH] Set boolean custom columns from personal.ini when t/true/yes/y/1 vs f/false/no/n/0. --- calibre-plugin/ffdl_plugin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index cfa35e8..a37c87d 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -1576,6 +1576,13 @@ class FanFictionDownLoaderPlugin(InterfaceAction): else: val = val if val != '': + if coldef['datatype'] == 'bool': + if val.lower() in ('t','true','1','yes','y'): + val = True + elif val.lower() in ('f','false','0','no','n'): + val = False + else: + val = None # for tri-state 'booleans'. Yes/No/Null db.set_custom(book_id, val, label=label, commit=False) if flag == 'a':