]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/video-transcoding.ts
Cleanup useless express validator messages
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / video-transcoding.ts
index 34f231d454886bdf4c2e7354932e2bb0eae4b6c4..36b9799e6fde767ff31c9d51d2e81071ba5b4dbb 100644 (file)
@@ -11,7 +11,7 @@ const createTranscodingValidator = [
   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 })
@@ -37,7 +37,7 @@ const createTranscodingValidator = [
 
     // 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'