aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/upload.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-06-04 08:57:07 +0200
committerRigel Kent <sendmemail@rigelk.eu>2021-06-04 09:21:46 +0200
commit1c627fd8d2e60d4d790353886006485343d70084 (patch)
tree384fcd80a018eab2ace2a340d028b23359c07dc7 /server/controllers/api/videos/upload.ts
parentb96d21b744f3b0714636bd43e7f39fb33c3adb73 (diff)
downloadPeerTube-1c627fd8d2e60d4d790353886006485343d70084.tar.gz
PeerTube-1c627fd8d2e60d4d790353886006485343d70084.tar.zst
PeerTube-1c627fd8d2e60d4d790353886006485343d70084.zip
refactor docMiddleware to support operationId-only form
Diffstat (limited to 'server/controllers/api/videos/upload.ts')
-rw-r--r--server/controllers/api/videos/upload.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts
index 93a68f759..783cc329a 100644
--- a/server/controllers/api/videos/upload.ts
+++ b/server/controllers/api/videos/upload.ts
@@ -6,7 +6,7 @@ import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
6import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' 6import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url'
7import { addOptimizeOrMergeAudioJob, buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' 7import { addOptimizeOrMergeAudioJob, buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video'
8import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' 8import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths'
9import { docMiddleware } from '@server/middlewares/doc' 9import { openapiOperationDoc } from '@server/middlewares/doc'
10import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' 10import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
11import { uploadx } from '@uploadx/core' 11import { uploadx } from '@uploadx/core'
12import { VideoCreate, VideoState } from '../../../../shared' 12import { VideoCreate, VideoState } from '../../../../shared'
@@ -61,7 +61,7 @@ const reqVideoFileAddResumable = createReqFiles(
61) 61)
62 62
63uploadRouter.post('/upload', 63uploadRouter.post('/upload',
64 docMiddleware('https://docs.joinpeertube.org/api-rest-reference.html#operation/uploadLegacy'), 64 openapiOperationDoc({ operationId: 'uploadLegacy' }),
65 authenticate, 65 authenticate,
66 reqVideoFileAdd, 66 reqVideoFileAdd,
67 asyncMiddleware(videosAddLegacyValidator), 67 asyncMiddleware(videosAddLegacyValidator),
@@ -69,7 +69,7 @@ uploadRouter.post('/upload',
69) 69)
70 70
71uploadRouter.post('/upload-resumable', 71uploadRouter.post('/upload-resumable',
72 docMiddleware('https://docs.joinpeertube.org/api-rest-reference.html#operation/uploadResumableInit'), 72 openapiOperationDoc({ operationId: 'uploadResumableInit' }),
73 authenticate, 73 authenticate,
74 reqVideoFileAddResumable, 74 reqVideoFileAddResumable,
75 asyncMiddleware(videosAddResumableInitValidator), 75 asyncMiddleware(videosAddResumableInitValidator),
@@ -82,7 +82,7 @@ uploadRouter.delete('/upload-resumable',
82) 82)
83 83
84uploadRouter.put('/upload-resumable', 84uploadRouter.put('/upload-resumable',
85 docMiddleware('https://docs.joinpeertube.org/api-rest-reference.html#operation/uploadResumable'), 85 openapiOperationDoc({ operationId: 'uploadResumable' }),
86 authenticate, 86 authenticate,
87 uploadxMiddleware, // uploadx doesn't use call next() before the file upload completes 87 uploadxMiddleware, // uploadx doesn't use call next() before the file upload completes
88 asyncMiddleware(videosAddResumableValidator), 88 asyncMiddleware(videosAddResumableValidator),