from __future__ import annotations import shutil from pathlib import Path from renderer.core.utils import safe_filename class ExportManager: def __init__(self, exports_dir: Path) -> None: self.exports_dir = exports_dir self.exports_dir.mkdir(parents=True, exist_ok=True) def save(self, source: Path, job_id: str, output_name: str) -> Path: filename = safe_filename(output_name) if not filename.lower().endswith(".mp4"): filename += ".mp4" target = self.exports_dir / f"{job_id}_{filename}" shutil.copy2(source, target) return target