]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/videos.ts
add video upload types, add doc middleware to more routes
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / videos.ts
index 52e6c57622db2bc81e61f15a0b962bd22ea2bce6..7f278c9f65f32065ca9f6f7c8e18189f4c017f16 100644 (file)
@@ -402,7 +402,8 @@ const videosAcceptChangeOwnershipValidator = [
     if (isAble === false) {
       res.fail({
         status: HttpStatusCode.PAYLOAD_TOO_LARGE_413,
-        message: 'The user video quota is exceeded with this video.'
+        message: 'The user video quota is exceeded with this video.',
+        type: ServerErrorCode.QUOTA_REACHED
       })
       return
     }
@@ -628,7 +629,8 @@ async function commonVideoChecksPass (parameters: {
   if (!isVideoFileSizeValid(videoFileSize.toString())) {
     res.fail({
       status: HttpStatusCode.PAYLOAD_TOO_LARGE_413,
-      message: 'This file is too large. It exceeds the maximum file size authorized.'
+      message: 'This file is too large. It exceeds the maximum file size authorized.',
+      type: ServerErrorCode.MAX_FILE_SIZE_REACHED
     })
     return false
   }
@@ -636,7 +638,8 @@ async function commonVideoChecksPass (parameters: {
   if (await isAbleToUploadVideo(user.id, videoFileSize) === false) {
     res.fail({
       status: HttpStatusCode.PAYLOAD_TOO_LARGE_413,
-      message: 'The user video quota is exceeded with this video.'
+      message: 'The user video quota is exceeded with this video.',
+      type: ServerErrorCode.QUOTA_REACHED
     })
     return false
   }