diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-04 08:57:07 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-04 09:21:46 +0200 |
commit | 1c627fd8d2e60d4d790353886006485343d70084 (patch) | |
tree | 384fcd80a018eab2ace2a340d028b23359c07dc7 /server/controllers/api/videos/upload.ts | |
parent | b96d21b744f3b0714636bd43e7f39fb33c3adb73 (diff) | |
download | PeerTube-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.ts | 8 |
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' | |||
6 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' | 6 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' |
7 | import { addOptimizeOrMergeAudioJob, buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' | 7 | import { addOptimizeOrMergeAudioJob, buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' |
8 | import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' | 8 | import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' |
9 | import { docMiddleware } from '@server/middlewares/doc' | 9 | import { openapiOperationDoc } from '@server/middlewares/doc' |
10 | import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' | 10 | import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' |
11 | import { uploadx } from '@uploadx/core' | 11 | import { uploadx } from '@uploadx/core' |
12 | import { VideoCreate, VideoState } from '../../../../shared' | 12 | import { VideoCreate, VideoState } from '../../../../shared' |
@@ -61,7 +61,7 @@ const reqVideoFileAddResumable = createReqFiles( | |||
61 | ) | 61 | ) |
62 | 62 | ||
63 | uploadRouter.post('/upload', | 63 | uploadRouter.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 | ||
71 | uploadRouter.post('/upload-resumable', | 71 | uploadRouter.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 | ||
84 | uploadRouter.put('/upload-resumable', | 84 | uploadRouter.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), |