From e83738653ca3688569f37ef1b8f5bf3fe70060ad Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 2 Jul 2013 09:14:21 +0530 Subject: [PATCH] Fix #25 (bugfix: pass book_id to FileType plugins on postimport instead of __builtins__.id()) --- src/calibre/library/database2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 98e0190ecd..435d8edeeb 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -1500,8 +1500,9 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): format = os.path.splitext(npath)[-1].lower().replace('.', '').upper() stream = lopen(npath, 'rb') format = check_ebook_format(stream, format) - retval = self.add_format(index, format, stream, replace=replace, - index_is_id=index_is_id, path=path, notify=notify) + id = index if index_is_id else self.id(index) + retval = self.add_format(id, format, stream, replace=replace, + index_is_id=True, path=path, notify=notify) run_plugins_on_postimport(self, id, format) return retval