1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Remove useless async

This commit is contained in:
Chocobozzz 2021-08-25 16:14:11 +02:00
parent 851675c559
commit 98ab5dc810
No known key found for this signature in database
GPG key ID: 583A612D890159BE
35 changed files with 49 additions and 43 deletions

View file

@ -108,7 +108,7 @@ videoChannelRouter.delete('/:nameWithHost',
videoChannelRouter.get('/:nameWithHost',
asyncMiddleware(videoChannelsNameWithHostValidator),
asyncMiddleware(getVideoChannel)
getVideoChannel
)
videoChannelRouter.get('/:nameWithHost/video-playlists',
@ -281,7 +281,7 @@ async function removeVideoChannel (req: express.Request, res: express.Response)
return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
}
async function getVideoChannel (req: express.Request, res: express.Response) {
function getVideoChannel (req: express.Request, res: express.Response) {
const videoChannel = res.locals.videoChannel
if (videoChannel.isOutdated()) {

View file

@ -102,7 +102,7 @@ videosRouter.get('/:id',
optionalAuthenticate,
asyncMiddleware(videosCustomGetValidator('for-api')),
asyncMiddleware(checkVideoFollowConstraints),
asyncMiddleware(getVideo)
getVideo
)
videosRouter.post('/:id/views',
openapiOperationDoc({ operationId: 'addView' }),
@ -141,7 +141,7 @@ function listVideoPrivacies (_req: express.Request, res: express.Response) {
res.json(VIDEO_PRIVACIES)
}
async function getVideo (_req: express.Request, res: express.Response) {
function getVideo (_req: express.Request, res: express.Response) {
const video = res.locals.videoAPI
if (video.isOutdated()) {

View file

@ -39,7 +39,7 @@ liveRouter.post('/live',
liveRouter.get('/live/:videoId',
authenticate,
asyncMiddleware(videoLiveGetValidator),
asyncRetryTransactionMiddleware(getLiveVideo)
getLiveVideo
)
liveRouter.put('/live/:videoId',
@ -57,7 +57,7 @@ export {
// ---------------------------------------------------------------------------
async function getLiveVideo (req: express.Request, res: express.Response) {
function getLiveVideo (req: express.Request, res: express.Response) {
const videoLive = res.locals.videoLive
return res.json(videoLive.toFormattedJSON())