combine audiobook better logging
This commit is contained in:
1 parent
8cccf674cf
commit
e4f1cce494
1 file changed
+3
-3
@@ -127,7 +127,7 @@ def create_m4b(root_path: Path, book_dir: Path) -> None:
|
|||||||
text=True,
|
text=True,
|
||||||
)
|
)
|
||||||
if result.returncode == 234:
|
if result.returncode == 234:
|
||||||
log_message(f"{YELLOW}[WARNING]{RESET} {result.returncode} retrying with aac encoder")
|
log_message(f"{YELLOW}[WARNING]{RESET} - {book_dir.name} - {result.returncode} retrying with aac encoder")
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
cmd_backup,
|
cmd_backup,
|
||||||
stdout=log,
|
stdout=log,
|
||||||
@@ -138,9 +138,9 @@ def create_m4b(root_path: Path, book_dir: Path) -> None:
|
|||||||
output_file_tmp.rename(output_file_final)
|
output_file_tmp.rename(output_file_final)
|
||||||
for media in media_files:
|
for media in media_files:
|
||||||
media.unlink()
|
media.unlink()
|
||||||
log_message(f"{GREEN}[SUCCESS]{RESET}, delete media files")
|
log_message(f"{GREEN}[SUCCESS]{RESET} - {book_dir.name} - delete media files")
|
||||||
else:
|
else:
|
||||||
log_message(f"{RED}[ERROR]{RESET} Code: {result.returncode}, Stderr: {result.stderr}")
|
log_message(f"{RED}[ERROR]{RESET} - {book_dir.name} - Code: {result.returncode}, Stderr: {result.stderr}")
|
||||||
|
|
||||||
def find_book_dirs(root: Path) -> tuple[list[Any], int]:
|
def find_book_dirs(root: Path) -> tuple[list[Any], int]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in new issue
Block a user