From 26f5dd45b23ba91fea1361d7a1eb558fd8fc45ec Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 28 Feb 2025 22:27:26 +0530 Subject: [PATCH] Fix kepubify template result not being used --- src/calibre/devices/kobo/driver.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index f20dfb24d9..cd8d3510f1 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -2310,13 +2310,16 @@ class KOBOTOUCH(KOBO): return True from calibre.ebooks.metadata.book.formatter import SafeFormat kepubify = SafeFormat().safe_format(template, mi, 'Open With template error', mi) - debug_print(f'kepubify_template_result for {mi.title}:', kepubify) + debug_print(f'kepubify_template_result for {mi.title}:', repr(kepubify)) if kepubify is not None and kepubify.startswith('PLUGBOARD TEMPLATE ERROR'): import sys print(f'kepubify template: {template} returned error', file=sys.stderr) kepubifiable.add(mi.uuid) return True - return kepubify and kepubify != 'false' + if kepubify and kepubify != 'false': + kepubifiable.add(mi.uuid) + return True + return False return modify_css self.extra_css, self.extra_sheet = self.get_extra_css()