media-server / src /keepVideo.mts
jbilcke-hf's picture
jbilcke-hf HF staff
read for batch 3
a99b4ac
raw
history blame
385 Bytes
import path from 'node:path'
import fs from 'node:fs'
import tmpDir from 'temp-dir'
export const keepVideo = async (fileName: string): Promise<string> => {
const sourceFilePath = path.join(tmpDir, fileName)
const targetFilePath = path.join(process.env.WEBTV_VIDEO_STORAGE_PATH_NEXT, fileName)
await fs.promises.rename(sourceFilePath, targetFilePath)
return targetFilePath
}