From ccfa34c9ece81170df7ccf02f49837d0a8ced1fd Mon Sep 17 00:00:00 2001 From: j-howell Date: Fri, 18 May 2018 08:51:48 -0400 Subject: [PATCH] Detect when format has changed during import --- src/calibre/db/cli/cmd_add.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/db/cli/cmd_add.py b/src/calibre/db/cli/cmd_add.py index d434396c94..5c7ddc7fed 100644 --- a/src/calibre/db/cli/cmd_add.py +++ b/src/calibre/db/cli/cmd_add.py @@ -44,6 +44,8 @@ def book(db, notify_changes, is_remote, args): else: path = data path = run_import_plugins([path])[0] + fmt = os.path.splitext(path)[1] + fmt = fmt[1:] if fmt else None with lopen(path, 'rb') as stream: mi = get_metadata(stream, stream_type=fmt, use_libprs_metadata=True) if not mi.title: