Skip to content

Commit

Permalink
Fix invalid cover_id reference
Browse files Browse the repository at this point in the history
Fixes #170
  • Loading branch information
jgoguen committed Aug 2, 2024
1 parent 96784a1 commit e075e20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
CONFIGDIR = os.path.join(config_dir, "plugins")
REFERENCE_KEPUB = os.path.join(CONFIGDIR, "reference.kepub.epub")
PLUGIN_VERSION = (3, 6, 8)
PLUGIN_VERSION = (3, 6, 9)
PLUGIN_MINIMUM_CALIBRE_VERSION = (5, 0, 0)


Expand Down Expand Up @@ -138,7 +138,7 @@ def modify_epub(
log.info(f"Found cover image ID '{cover_id}'")

cover_node_list: ElementBase = opf.xpath(
f'./opf:manifest/opf:item[@id="{v}"]',
f'./opf:manifest/opf:item[@id="{cover_id}"]',
namespaces=OPF_NAMESPACES,
)
if len(cover_node_list) > 0:
Expand Down Expand Up @@ -230,7 +230,7 @@ def modify_epub(
if opts.get("extended_kepub_features", True):
if metadata is not None:
log.info(
"Adding extended Kobo features to {metadata.title} by "
f"Adding extended Kobo features to {metadata.title} by "
+ " and ".join(metadata.authors)
)

Expand Down
4 changes: 3 additions & 1 deletion conversion/kepub_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def convert(self, oeb_book, output, input_plugin, opts, _):
oeb_book, output, input_plugin, opts, common.log
)
common.log.debug("Done ePub conversion")
container = KEPubContainer(output, common.log, opts.kepub_clean_markup)
container = KEPubContainer(
output, common.log, do_cleanup=opts.kepub_clean_markup
)

if container.is_drm_encumbered:
common.log.error("DRM-encumbered container, skipping conversion")
Expand Down

0 comments on commit e075e20

Please sign in to comment.