From 92597efce68653c968e4b77c0c9718df3c773e57 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Fri, 15 Mar 2013 23:36:33 -0500 Subject: [PATCH] PI: Strip ',' from metadata set to int/float col by custom_columns_settings. For favs, reviews, etc from site specific metadata. --- calibre-plugin/ffdl_plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index ad27de4..4736796 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -1363,9 +1363,13 @@ class FanFictionDownLoaderPlugin(InterfaceAction): else: coldef = custom_columns[custcol] label = coldef['label'] - + if flag == 'r' or book['added']: # flag 'n' isn't actually needed--*always* set if configured and new book. - db.set_custom(book_id, book['all_metadata'][meta], label=label, commit=False) + if coldef['datatype'] in ('int','float'): # for favs, etc--site specific metadata. + val = unicode(book['all_metadata'][meta]).replace(",","") + else: + val = book['all_metadata'][meta] + db.set_custom(book_id, val, label=label, commit=False) if flag == 'a': vallist = []