mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 22:13:43 +02:00
...
This commit is contained in:
parent
f0af17ee1d
commit
00d3a5fad2
1 changed files with 6 additions and 0 deletions
|
|
@ -1404,6 +1404,12 @@ def create_book_entry(self, mi, cover=None, add_duplicates=True, force_id=None,
|
|||
|
||||
@api
|
||||
def add_books(self, books, add_duplicates=True, apply_import_tags=True, preserve_uuid=False, run_hooks=True, dbapi=None):
|
||||
'''
|
||||
Add the specified books to the library. Books should be an iterable of
|
||||
2-tuples, each 2-tuple of the form (mi, format_map) where mi is a
|
||||
Metadata object and format_map is a dictionary of the form {fmt: path_or_stream},
|
||||
for example: {'EPUB': '/path/to/file.epub'}.
|
||||
'''
|
||||
duplicates, ids = [], []
|
||||
for mi, format_map in books:
|
||||
book_id = self.create_book_entry(mi, add_duplicates=add_duplicates, apply_import_tags=apply_import_tags, preserve_uuid=preserve_uuid)
|
||||
|
|
|
|||
Loading…
Reference in a new issue