File size: 552 Bytes
5dfc565
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import path from "path"

import { completedFilesDirFilePath, pendingFilesDirFilePath } from "../config.mts"
import { moveFile } from "./moveFile.mts"

export const moveVideoFromPendingToCompleted = async (pendingFileName: string, completedFileName?: string) => {
  if (!completedFileName) {
    completedFileName = pendingFileName
  }
  const pendingFilePath = path.join(pendingFilesDirFilePath, pendingFileName)
  const completedFilePath = path.join(completedFilesDirFilePath, completedFileName)

  await moveFile(pendingFilePath, completedFilePath)
}