aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-25 16:14:11 +0200
committerChocobozzz <me@florianbigard.com>2021-08-26 10:01:42 +0200
commit98ab5dc81048d47d08a231f17698128f959e59b2 (patch)
tree7f74f835dc35d9f72918c56857f7f28b70d7053f /server/controllers/api
parent851675c5591dcab1070183f0ed1b1a788de07d2c (diff)
downloadPeerTube-98ab5dc81048d47d08a231f17698128f959e59b2.tar.gz
PeerTube-98ab5dc81048d47d08a231f17698128f959e59b2.tar.zst
PeerTube-98ab5dc81048d47d08a231f17698128f959e59b2.zip
Remove useless async
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/video-channel.ts4
-rw-r--r--server/controllers/api/videos/index.ts4
-rw-r--r--server/controllers/api/videos/live.ts4
3 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts
index 7bdb33737..a0c6601d9 100644
--- a/server/controllers/api/video-channel.ts
+++ b/server/controllers/api/video-channel.ts
@@ -108,7 +108,7 @@ videoChannelRouter.delete('/:nameWithHost',
108 108
109videoChannelRouter.get('/:nameWithHost', 109videoChannelRouter.get('/:nameWithHost',
110 asyncMiddleware(videoChannelsNameWithHostValidator), 110 asyncMiddleware(videoChannelsNameWithHostValidator),
111 asyncMiddleware(getVideoChannel) 111 getVideoChannel
112) 112)
113 113
114videoChannelRouter.get('/:nameWithHost/video-playlists', 114videoChannelRouter.get('/:nameWithHost/video-playlists',
@@ -281,7 +281,7 @@ async function removeVideoChannel (req: express.Request, res: express.Response)
281 return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end() 281 return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
282} 282}
283 283
284async function getVideoChannel (req: express.Request, res: express.Response) { 284function getVideoChannel (req: express.Request, res: express.Response) {
285 const videoChannel = res.locals.videoChannel 285 const videoChannel = res.locals.videoChannel
286 286
287 if (videoChannel.isOutdated()) { 287 if (videoChannel.isOutdated()) {
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 49490f79b..10833d48b 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -102,7 +102,7 @@ videosRouter.get('/:id',
102 optionalAuthenticate, 102 optionalAuthenticate,
103 asyncMiddleware(videosCustomGetValidator('for-api')), 103 asyncMiddleware(videosCustomGetValidator('for-api')),
104 asyncMiddleware(checkVideoFollowConstraints), 104 asyncMiddleware(checkVideoFollowConstraints),
105 asyncMiddleware(getVideo) 105 getVideo
106) 106)
107videosRouter.post('/:id/views', 107videosRouter.post('/:id/views',
108 openapiOperationDoc({ operationId: 'addView' }), 108 openapiOperationDoc({ operationId: 'addView' }),
@@ -141,7 +141,7 @@ function listVideoPrivacies (_req: express.Request, res: express.Response) {
141 res.json(VIDEO_PRIVACIES) 141 res.json(VIDEO_PRIVACIES)
142} 142}
143 143
144async function getVideo (_req: express.Request, res: express.Response) { 144function getVideo (_req: express.Request, res: express.Response) {
145 const video = res.locals.videoAPI 145 const video = res.locals.videoAPI
146 146
147 if (video.isOutdated()) { 147 if (video.isOutdated()) {
diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts
index ed4da8f47..151ff354b 100644
--- a/server/controllers/api/videos/live.ts
+++ b/server/controllers/api/videos/live.ts
@@ -39,7 +39,7 @@ liveRouter.post('/live',
39liveRouter.get('/live/:videoId', 39liveRouter.get('/live/:videoId',
40 authenticate, 40 authenticate,
41 asyncMiddleware(videoLiveGetValidator), 41 asyncMiddleware(videoLiveGetValidator),
42 asyncRetryTransactionMiddleware(getLiveVideo) 42 getLiveVideo
43) 43)
44 44
45liveRouter.put('/live/:videoId', 45liveRouter.put('/live/:videoId',
@@ -57,7 +57,7 @@ export {
57 57
58// --------------------------------------------------------------------------- 58// ---------------------------------------------------------------------------
59 59
60async function getLiveVideo (req: express.Request, res: express.Response) { 60function getLiveVideo (req: express.Request, res: express.Response) {
61 const videoLive = res.locals.videoLive 61 const videoLive = res.locals.videoLive
62 62
63 return res.json(videoLive.toFormattedJSON()) 63 return res.json(videoLive.toFormattedJSON())