combine audiobooks: create audiobook in temp dir
add coloured skip message
This commit is contained in:
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:
|
if not media_files:
|
||||||
return
|
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"
|
output_file_final = book_dir / f"{book_dir.name}.m4b"
|
||||||
|
|
||||||
if output_file_final.exists():
|
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")
|
log_message("Book already present")
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -61,6 +58,7 @@ def create_m4b(root_path: Path, book_dir: Path) -> None:
|
|||||||
with (tempfile.TemporaryDirectory() as tmp):
|
with (tempfile.TemporaryDirectory() as tmp):
|
||||||
tmpdir = Path(tmp)
|
tmpdir = Path(tmp)
|
||||||
|
|
||||||
|
output_file_tmp = tmpdir / f"{book_dir.name}.m4b"
|
||||||
concat_file = tmpdir / "concat.txt"
|
concat_file = tmpdir / "concat.txt"
|
||||||
metadata_file = tmpdir / "chapters.txt"
|
metadata_file = tmpdir / "chapters.txt"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user