From fc7ce8da2d2dee4f2c235ebce8c3ab59be832778 Mon Sep 17 00:00:00 2001 From: Thore Schillmann Date: Wed, 13 Jul 2022 15:39:01 +0000 Subject: [PATCH] cleanup --- cps/helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cps/helper.py b/cps/helper.py index 77323d0b..52174b02 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -917,7 +917,7 @@ def do_download_file(book, book_format, client, data, headers): tmp_dir = os.path.join(gettempdir(), 'calibre_web') if not os.path.isdir(tmp_dir): os.mkdir(tmp_dir) - calibredb_binarypath = config.get_calibre_binarypath("calibredb") + calibredb_binarypath = get_calibre_binarypath("calibredb") opf_command = [calibredb_binarypath, 'export', '--dont-write-opf', str(book.id), '--with-library', config.config_calibre_dir, '--to-dir', tmp_dir, '--formats', book_format, "--template", "{} - {{authors}}".format(book.title)] @@ -928,9 +928,9 @@ def do_download_file(book, book_format, client, data, headers): _, err = p.communicate() if err: log.error('Metadata embedder encountered an error: %s', err) - except (ValueError, OSError) as e: + except OSError as ex: # ToDo real error handling - log.error_or_exception(e) + log.error_or_exception(ex) response = make_response(send_from_directory(tmp_dir, file_name + "." + book_format)) # ToDo Check headers parameter