From d8b443fd26228f2d982998666ffbf4e70b35e459 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Feb 2009 19:03:37 -0800 Subject: [PATCH] Fix #1885 (Import plugin does not run when Adding from Directories) --- src/calibre/library/database2.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 388a2d4fdb..2686c3a1cc 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -1217,8 +1217,7 @@ class LibraryDatabase2(LibraryDatabase): ext = os.path.splitext(path)[1][1:].lower() if ext == 'opf': continue - stream = open(path, 'rb') - self.add_format(id, ext, stream, index_is_id=True) + self.add_format_with_hooks(id, ext, path, index_is_id=True) self.conn.commit() self.data.refresh_ids(self.conn, [id]) # Needed to update format list and size if notify: