View Single Post
Old 05-26-2014, 02:14 PM   #1
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
having metadata.opf, cover.jpg + title.[pdf|epub|..] what's the best function to use?

If I have metadata.opf, cover.jpg + title.[pdf|epub|..] in the same folder and want to add that book to current (running) calibre library what's the best calibre function/method to use from plugin?

something like:

book_folder/
metadata.opf
cover.jpg
title.pdf
title.epub

calibre.deep_inside.add_book(path_to_folder)
or
calibre.deep_inside.import_book('path/to/book_folder/metadata.opf', formats['path/to/book_folder/title.pdf', 'path/to/book_folder/title.epub'], 'path/to/book_folder/cover.jpg)

I found quite few hints looking at source but couldn't figure out what would be "the right way" to do that. I know I can also do that with CLI calibredb but would rather do that through internal calibre call.
kabirmaar is offline   Reply With Quote