Fix kepubify template result not being used

This commit is contained in:
Kovid Goyal 2025-02-28 22:27:26 +05:30
parent 7f4487d318
commit 26f5dd45b2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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()