mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Improve handling of KFX metadata
This commit is contained in:
parent
a5aec9233f
commit
b99645bbbc
@ -254,11 +254,11 @@ def extract_metadata(container_data):
|
||||
|
||||
# locate book metadata within the container data structures
|
||||
|
||||
metadata_entity = {}
|
||||
|
||||
for entity_type, entity_id, entity_value in container_data:
|
||||
if entity_type == PROP_METADATA:
|
||||
for key, value in entity_value.items():
|
||||
if key in METADATA_PROPERTIES:
|
||||
metadata[METADATA_PROPERTIES[key]].append(value)
|
||||
metadata_entity = entity_value
|
||||
|
||||
elif entity_type == PROP_METADATA2:
|
||||
if entity_value is not None:
|
||||
@ -270,6 +270,10 @@ def extract_metadata(container_data):
|
||||
# assume first image is the cover
|
||||
metadata[COVER_KEY] = entity_value
|
||||
|
||||
for key, value in metadata_entity.items():
|
||||
if key in METADATA_PROPERTIES:
|
||||
metadata[METADATA_PROPERTIES[key]].append(value)
|
||||
|
||||
return metadata
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user