Better logging

This commit is contained in:
WilliamSoderberg committed 2026-09-11 13:31:43 +02:00 Verified
1 parent c026685b59
commit a84f87c906
7 files changed
+59 -39

No files matched your search

+4 -2
View File
@@ -1,10 +1,12 @@
# packager.py
import zipfile
from pathlib import Path
def zip_files(slug, chapter: dict, files: list[Path], save_dir: Path):
save_dir.joinpath(slug).mkdir(exist_ok=True)
filename = save_dir.joinpath(slug).joinpath(f"{slug} Ch.{chapter.get('nr'):g}.cbz") # type: ignore
save_dir.joinpath(slug).mkdir(parents=True, exist_ok=True)
filename = save_dir.joinpath(slug).joinpath(f"{slug} Ch.{chapter.get('nr'):g}.cbz")
with zipfile.ZipFile(filename, "w") as zf:
for file in files:
zf.write(file, file.name)