mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-21 19:16:07 +01:00
Improve handling of KFX metadata
This commit is contained in:
parent
a5aec9233f
commit
b99645bbbc
1 changed files with 7 additions and 3 deletions
|
|
@ -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…
Reference in a new issue