|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Member
![]() 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. |
|
|
|
|
|
#2 |
|
Member
![]() Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
|
Code:
from calibre.gui2.ui import get_gui
get_gui().current_db.import_book_directory('path_to_folder/')
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jun 2017
Location: France
Device: Vivlio Touch HD+ [PB632]
|
Hello,
I've tried max@pc-max:~$ from calibre.gui2.ui import get_gui get_gui().current_db.import_book_directory('/home/max/Bibliothèque calibre/Collectif/test/') But i've got: bash: erreur de syntaxe près du symbole inattendu « ( » Thanks for your help |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extra id in id line of opf after use of epub metadata editor program | mrmikel | Editor | 3 | 02-22-2014 08:53 AM |
| Change opf filename from content.opf to title.opf | northstar7 | Sigil | 3 | 09-23-2013 01:44 PM |
| cover.jpg & metadata.opf | BetterRed | Calibre | 1 | 05-10-2013 11:29 PM |
| Custom columns to call up metadata from epub's opf? | eosrose | Library Management | 1 | 03-21-2013 05:33 AM |
| Calibre changes size of cover.jpg when copy to new Libary --> see PDF attached | icq70610 | Calibre | 5 | 10-02-2010 02:29 PM |