combine audiobooks: create audiobook in temp dir

add coloured skip message
This commit is contained in:
Lucas Vivo committed 2026-10-07 14:16:41 +02:00
1 parent 57520eaa04
commit fc9a2dcf0e
1 file changed
+2 -4
@@ -46,13 +46,10 @@ def create_m4b(root_path: Path, book_dir: Path) -> None:
if not media_files:
return
output_file_tmp = root_path / "tmp" / f"{book_dir.name}.m4b"
if not output_file_tmp.parent.exists():
output_file_tmp.parent.mkdir()
output_file_final = book_dir / f"{book_dir.name}.m4b"
if output_file_final.exists():
log_message(f"[SKIP] {output_file_final}")
log_message(f"{RED}[SKIP]{RESET} {output_file_final}")
log_message("Book already present")
return
@@ -61,6 +58,7 @@ def create_m4b(root_path: Path, book_dir: Path) -> None:
with (tempfile.TemporaryDirectory() as tmp):
tmpdir = Path(tmp)
output_file_tmp = tmpdir / f"{book_dir.name}.m4b"
concat_file = tmpdir / "concat.txt"
metadata_file = tmpdir / "chapters.txt"