diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index 1a15d82..338f901 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -1469,7 +1469,8 @@ class FanFictionDownLoaderPlugin(InterfaceAction): db.set_custom(book_id, book['all_metadata'][meta], label, commit=False) elif coldef['datatype'] in ('int','float'): num = unicode(book['all_metadata'][meta]).replace(",","") - db.set_custom(book_id, num, label=label, commit=False) + if num != '': + db.set_custom(book_id, num, label=label, commit=False) elif coldef['datatype'] == 'bool' and meta.startswith('status-'): if meta == 'status-C': val = book['all_metadata']['status'] == 'Completed' diff --git a/fanficdownloader/htmlcleanup.py b/fanficdownloader/htmlcleanup.py index 4dfb306..fc56ca8 100644 --- a/fanficdownloader/htmlcleanup.py +++ b/fanficdownloader/htmlcleanup.py @@ -69,8 +69,9 @@ def removeEntities(text): if text is None: return "" - if not (isinstance(text,str) or isinstance(text,unicode)): - return str(text) + + if not isinstance(text,basestring): + return unicode(text) try: t = text.decode('utf-8')