async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking videoImportAddValidator parameters', { parameters: req.body })
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking videoImportAddValidator parameters', { parameters: req.body })
- return res.status(HttpStatusCode.CONFLICT_409)
- .json({ error: 'HTTP import is not enabled on this instance.' })
+
+ return res.fail({
+ status: HttpStatusCode.CONFLICT_409,
+ message: 'HTTP import is not enabled on this instance.'
+ })
- return res.status(HttpStatusCode.CONFLICT_409)
- .json({ error: 'Torrent/magnet URI import is not enabled on this instance.' })
+
+ return res.fail({
+ status: HttpStatusCode.CONFLICT_409,
+ message: 'Torrent/magnet URI import is not enabled on this instance.'
+ })
}
if (!await doesVideoChannelOfAccountExist(req.body.channelId, user, res)) return cleanUpReqFiles(req)
}
if (!await doesVideoChannelOfAccountExist(req.body.channelId, user, res)) return cleanUpReqFiles(req)
if (!acceptedResult || acceptedResult.accepted !== true) {
logger.info('Refused to import video.', { acceptedResult, acceptParameters })
if (!acceptedResult || acceptedResult.accepted !== true) {
logger.info('Refused to import video.', { acceptedResult, acceptParameters })