diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-06 10:21:06 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-06 10:21:06 +0200 |
commit | c756bae079e02873f6433582ca14a092fec0db27 (patch) | |
tree | 2b24e065144fdb11b8b1ef58ef3157530bd6b2d1 /server/middlewares/validators/videos/videos.ts | |
parent | fc21ef5c62d845576a916414468b3a57370a57b2 (diff) | |
download | PeerTube-c756bae079e02873f6433582ca14a092fec0db27.tar.gz PeerTube-c756bae079e02873f6433582ca14a092fec0db27.tar.zst PeerTube-c756bae079e02873f6433582ca14a092fec0db27.zip |
add video upload types, add doc middleware to more routes
Diffstat (limited to 'server/middlewares/validators/videos/videos.ts')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 52e6c5762..7f278c9f6 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -402,7 +402,8 @@ const videosAcceptChangeOwnershipValidator = [ | |||
402 | if (isAble === false) { | 402 | if (isAble === false) { |
403 | res.fail({ | 403 | res.fail({ |
404 | status: HttpStatusCode.PAYLOAD_TOO_LARGE_413, | 404 | status: HttpStatusCode.PAYLOAD_TOO_LARGE_413, |
405 | message: 'The user video quota is exceeded with this video.' | 405 | message: 'The user video quota is exceeded with this video.', |
406 | type: ServerErrorCode.QUOTA_REACHED | ||
406 | }) | 407 | }) |
407 | return | 408 | return |
408 | } | 409 | } |
@@ -628,7 +629,8 @@ async function commonVideoChecksPass (parameters: { | |||
628 | if (!isVideoFileSizeValid(videoFileSize.toString())) { | 629 | if (!isVideoFileSizeValid(videoFileSize.toString())) { |
629 | res.fail({ | 630 | res.fail({ |
630 | status: HttpStatusCode.PAYLOAD_TOO_LARGE_413, | 631 | status: HttpStatusCode.PAYLOAD_TOO_LARGE_413, |
631 | message: 'This file is too large. It exceeds the maximum file size authorized.' | 632 | message: 'This file is too large. It exceeds the maximum file size authorized.', |
633 | type: ServerErrorCode.MAX_FILE_SIZE_REACHED | ||
632 | }) | 634 | }) |
633 | return false | 635 | return false |
634 | } | 636 | } |
@@ -636,7 +638,8 @@ async function commonVideoChecksPass (parameters: { | |||
636 | if (await isAbleToUploadVideo(user.id, videoFileSize) === false) { | 638 | if (await isAbleToUploadVideo(user.id, videoFileSize) === false) { |
637 | res.fail({ | 639 | res.fail({ |
638 | status: HttpStatusCode.PAYLOAD_TOO_LARGE_413, | 640 | status: HttpStatusCode.PAYLOAD_TOO_LARGE_413, |
639 | message: 'The user video quota is exceeded with this video.' | 641 | message: 'The user video quota is exceeded with this video.', |
642 | type: ServerErrorCode.QUOTA_REACHED | ||
640 | }) | 643 | }) |
641 | return false | 644 | return false |
642 | } | 645 | } |