refactor(media): add shared ffmpeg helpers

This commit is contained in:
Peter Steinberger
2026-03-03 01:13:39 +00:00
parent 1187464041
commit 687ef2e00f
4 changed files with 103 additions and 0 deletions

12
src/media/temp-files.ts Normal file
View File

@@ -0,0 +1,12 @@
import fs from "node:fs/promises";
export async function unlinkIfExists(filePath: string | null | undefined): Promise<void> {
if (!filePath) {
return;
}
try {
await fs.unlink(filePath);
} catch {
// Best-effort cleanup for temp files.
}
}