VideoChain-API / src /scheduler /saveCompletedVideo.mts
jbilcke-hf's picture
jbilcke-hf HF staff
add "movie director assistant" LLM step
e4e0e54
raw
history blame
578 Bytes
import path from "path"
import { Video } from "../types.mts"
import { completedMetadataDirFilePath, pendingMetadataDirFilePath } from "../config.mts"
import { moveFile } from "../utils/moveFile.mts"
export const saveCompletedVideo = async (video: Video) => {
const metadataFileName = `${video.ownerId}_${video.id}.json`
const pendingMetadataFilePath = path.join(pendingMetadataDirFilePath, metadataFileName)
const completedMetadataFilePath = path.join(completedMetadataDirFilePath, metadataFileName)
await moveFile(pendingMetadataFilePath, completedMetadataFilePath)
}