VideoChain-API / src /utils /copyVideoFromPendingToCompleted.mts
jbilcke-hf's picture
jbilcke-hf HF staff
ok! now, time to debug and build the frontend..
5dfc565
raw
history blame
636 Bytes
import path from "node:path"
import { promises as fs } from "node:fs"
import { completedTasksDirFilePath, pendingFilesDirFilePath } from "../config.mts"
export const copyVideoFromPendingToCompleted = async (pendingFileName: string, completedFileName?: string) => {
if (!completedFileName) {
completedFileName = pendingFileName
}
const pendingFilePath = path.join(pendingFilesDirFilePath, pendingFileName)
const completedFilePath = path.join(completedTasksDirFilePath, completedFileName)
await fs.copyFile(pendingFilePath, completedFilePath)
console.log(`copied file from ${pendingFilePath} to ${completedFilePath}`)
}