mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-06 03:13:43 +02:00
Fix a bug that prevented post-import file type plugins from being run when adding books via the GUI
This commit is contained in:
parent
1b5519b294
commit
76186773aa
1 changed files with 6 additions and 2 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
from PyQt5.Qt import QThread, QObject, Qt, QProgressDialog, pyqtSignal, QTimer
|
||||
|
||||
from calibre.customize.ui import run_plugins_on_postimport
|
||||
from calibre.ptempfile import PersistentTemporaryDirectory
|
||||
from calibre.gui2.dialogs.progress import ProgressDialog
|
||||
from calibre.gui2 import (error_dialog, info_dialog, gprefs,
|
||||
|
|
@ -268,8 +269,11 @@ def add_formats(self, id, formats, replace=True):
|
|||
for path in formats:
|
||||
fmt = os.path.splitext(path)[-1].replace('.', '').upper()
|
||||
with open(path, 'rb') as f:
|
||||
self.db.add_format(id, fmt, f, index_is_id=True,
|
||||
notify=False, replace=replace)
|
||||
# At this point, the filetype on import plugins have already
|
||||
# been run by the metadata reading code, so we only need to run
|
||||
# the postimport plugins, on a successful add.
|
||||
if self.db.add_format(id, fmt, f, index_is_id=True, notify=False, replace=replace):
|
||||
run_plugins_on_postimport(self.db, id, fmt)
|
||||
|
||||
# }}}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue