From 570371cc826c760f6800796ff5d11572468ed460 Mon Sep 17 00:00:00 2001 From: haraldpdl Date: Sat, 18 Apr 2026 07:27:33 +0200 Subject: [PATCH] Don't write a cover sibling per download (--dont-save-cover) calibredb export writes .jpg next to . by default, leaving an unused cover image in /tmp/calibre_web for every download that goes through do_calibre_export. The cover file is never read by calibre-web (cover serving uses a separate path), so it is pure waste of disk space and IO. Pass --dont-save-cover, paired with the existing --dont-write-opf, to skip the unwanted side-effect at the source. Verified that none of the three do_calibre_export call sites (download via do_download_file, email via tasks/mail.py, kepubify via tasks/convert.py) read the cover sibling. --- cps/embed_helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cps/embed_helper.py b/cps/embed_helper.py index f222bcd05..6a815889e 100644 --- a/cps/embed_helper.py +++ b/cps/embed_helper.py @@ -36,7 +36,8 @@ def do_calibre_export(book_id, book_format): if config.config_calibre_split: my_env['CALIBRE_OVERRIDE_DATABASE_PATH'] = os.path.join(config.config_calibre_dir, "metadata.db") library_path = config.get_book_path() - opf_command = [calibredb_binarypath, 'export', '--dont-write-opf', '--with-library', library_path, + opf_command = [calibredb_binarypath, 'export', '--dont-write-opf', '--dont-save-cover', + '--with-library', library_path, '--to-dir', tmp_dir, '--formats', book_format, "--template", "{}".format(temp_file_name), str(book_id)] p = process_open(opf_command, quotes, my_env)