isValidVideoIdParam('videoId'),
body('transcodingType')
- .custom(isValidCreateTranscodingType).withMessage('Should have a valid transcoding type'),
+ .custom(isValidCreateTranscodingType),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking createTranscodingValidator parameters', { parameters: req.body })
// Prefer using job info table instead of video state because before 4.0 failed transcoded video were stuck in "TO_TRANSCODE" state
const info = await VideoJobInfoModel.load(video.id)
- if (info && info.pendingTranscode !== 0) {
+ if (info && info.pendingTranscode > 0) {
return res.fail({
status: HttpStatusCode.CONFLICT_409,
message: 'This video is already being transcoded'