ai-tube / src /app /server /actions /ai-tube-hf /deleteVideoRequest.ts
jbilcke-hf's picture
jbilcke-hf HF staff
just a lil bit of plumbing
1185ec1
raw
history blame
No virus
581 Bytes
import { VideoInfo } from "@/types/general"
import { deleteFileFromDataset } from "./deleteFileFromDataset"
import { formatPromptFileName } from "../utils/formatPromptFileName"
export async function deleteVideoRequest({
video,
apiKey,
neverThrow,
}: {
video: VideoInfo
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,
})
}