From 4a6e4622edc7346ca379718e3e99d7c5e3b129fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=95=E3=82=A3=E3=83=AB=E3=82=BF=E3=83=BC=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=83=91=E3=83=BC?= <76888457+filterpaper@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:20:46 +0800 Subject: [PATCH] Use tempdir option for fusion path * Update makeFusion to use the same temporary directory location * Avoid creating an orphan "KCC-" in TMPDIR when --tempdir is set --- kindlecomicconverter/comic2ebook.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 8cd316c..7491c8a 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -1632,10 +1632,13 @@ def makeFusion(sources: List[str]): raise UserWarning('Fusion requires at least 2 sources. Did you forget to uncheck fusion?') start = perf_counter() first_path = Path(sources[0]) + fusion_parent = Path(gettempdir()) + if options.tempdir: + fusion_parent = first_path.parent if first_path.is_file(): - fusion_path = first_path.parent.joinpath(first_path.stem + ' [fused]') + fusion_path = fusion_parent.joinpath(first_path.stem + ' [fused]') else: - fusion_path = first_path.parent.joinpath(first_path.name + ' [fused]') + fusion_path = fusion_parent.joinpath(first_path.name + ' [fused]') print("Running Fusion") # Check if prefix is needed when user-specified ordering differs from OS natural sorting