mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
ccf54606be
commit
1c945b2d19
@ -183,11 +183,13 @@ class AddAction(InterfaceAction):
|
|||||||
from calibre.ebooks.oeb.polish.create import create_book
|
from calibre.ebooks.oeb.polish.create import create_book
|
||||||
pt = PersistentTemporaryFile(suffix='.' + format_)
|
pt = PersistentTemporaryFile(suffix='.' + format_)
|
||||||
pt.close()
|
pt.close()
|
||||||
mi = db.new_api.get_metadata(id_, get_cover=False,
|
try:
|
||||||
get_user_categories=False, cover_as_data=False)
|
mi = db.new_api.get_metadata(id_, get_cover=False,
|
||||||
create_book(mi, pt.name, fmt=format_)
|
get_user_categories=False, cover_as_data=False)
|
||||||
db.add_format_with_hooks(id_, format_, pt.name, index_is_id=True, notify=True)
|
create_book(mi, pt.name, fmt=format_)
|
||||||
os.remove(pt.name)
|
db.add_format_with_hooks(id_, format_, pt.name, index_is_id=True, notify=True)
|
||||||
|
finally:
|
||||||
|
os.remove(pt.name)
|
||||||
|
|
||||||
current_idx = self.gui.library_view.currentIndex()
|
current_idx = self.gui.library_view.currentIndex()
|
||||||
if current_idx.isValid():
|
if current_idx.isValid():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user