From fe0e299fa5095427cf0c0d886e98d986f5146c6d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 6 Feb 2014 08:02:23 +0530 Subject: [PATCH] calibredb add_custom_column: Fix a harmless error message when adding custom columns caused by the new db backend --- src/calibre/db/cache.py | 2 +- src/calibre/library/cli.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index c606db1b85..59e5c34cdd 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -1634,7 +1634,7 @@ class Cache(object): @write_api def create_custom_column(self, label, name, datatype, is_multiple, editable=True, display={}): - self.backend.create_custom_column(label, name, datatype, is_multiple, editable=editable, display=display) + return self.backend.create_custom_column(label, name, datatype, is_multiple, editable=editable, display=display) @write_api def set_custom_column_metadata(self, num, name=None, label=None, is_editable=None, diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py index 08775a9138..69e4bc811f 100644 --- a/src/calibre/library/cli.py +++ b/src/calibre/library/cli.py @@ -719,7 +719,7 @@ def command_export(args, dbpath): def do_add_custom_column(db, label, name, datatype, is_multiple, display): num = db.create_custom_column(label, name, datatype, is_multiple, display=display) - prints('Custom column created with id: %d'%num) + prints('Custom column created with id: %s'%num) def add_custom_column_option_parser(): from calibre.library.custom_columns import CustomColumns