2021-08-27 08:32:44 -04:00
|
|
|
import express from 'express'
|
2021-06-03 11:33:44 -04:00
|
|
|
import { VideoImportModel } from '@server/models/video/video-import'
|
2021-07-16 04:42:24 -04:00
|
|
|
import { HttpStatusCode } from '@shared/models'
|
2021-06-03 11:33:44 -04:00
|
|
|
|
|
|
|
async function doesVideoImportExist (id: number, res: express.Response) {
|
|
|
|
const videoImport = await VideoImportModel.loadAndPopulateVideo(id)
|
|
|
|
|
|
|
|
if (!videoImport) {
|
|
|
|
res.fail({
|
|
|
|
status: HttpStatusCode.NOT_FOUND_404,
|
|
|
|
message: 'Video import not found'
|
|
|
|
})
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
res.locals.videoImport = videoImport
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
|
|
|
doesVideoImportExist
|
|
|
|
}
|