ai-tube / src /app /api /actions /ai-tube-hf /deleteVideoRequest.ts
jbilcke-hf's picture
jbilcke-hf HF staff
working on some new features
3d4392e
raw
history blame
584 Bytes
import { MediaInfo } from "@/types/general"
import { deleteFileFromDataset } from "./deleteFileFromDataset"
import { formatPromptFileName } from "../../utils/formatPromptFileName"
export async function deleteVideoRequest({
video,
apiKey,
neverThrow,
}: {
video: MediaInfo
apiKey: string
neverThrow?: boolean
}): Promise<boolean> {
const repo = `datasets/${video.channel.datasetUser}/${video.channel.datasetName}`
const { fileName } = formatPromptFileName(video.id)
return deleteFileFromDataset({
repo,
path: fileName,
apiKey,
neverThrow,
})
}