mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Forgot another use of container.bookmark_data
This commit is contained in:
parent
2d2ee3f85c
commit
e3adac0c51
@ -802,8 +802,8 @@ def parse_annotations(raw):
|
|||||||
yield parse_annotation(annot)
|
yield parse_annotation(annot)
|
||||||
|
|
||||||
|
|
||||||
def get_stored_annotations(container):
|
def get_stored_annotations(container, bookmark_data):
|
||||||
raw = container.bookmark_data or b''
|
raw = bookmark_data or b''
|
||||||
if not raw:
|
if not raw:
|
||||||
return
|
return
|
||||||
if raw.startswith(EPUB_FILE_TYPE_MAGIC):
|
if raw.startswith(EPUB_FILE_TYPE_MAGIC):
|
||||||
@ -848,7 +848,7 @@ def render(pathtoebook, output_dir, book_hash=None, serialize_metadata=False, ex
|
|||||||
if extract_annotations:
|
if extract_annotations:
|
||||||
annotations = None
|
annotations = None
|
||||||
if bookmark_data:
|
if bookmark_data:
|
||||||
annotations = json_dumps(tuple(get_stored_annotations(container)))
|
annotations = json_dumps(tuple(get_stored_annotations(container, bookmark_data)))
|
||||||
if annotations:
|
if annotations:
|
||||||
with lopen(os.path.join(output_dir, 'calibre-book-annotations.json'), 'wb') as f:
|
with lopen(os.path.join(output_dir, 'calibre-book-annotations.json'), 'wb') as f:
|
||||||
f.write(annotations)
|
f.write(annotations)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user