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:
parent
851675c559
commit
98ab5dc810
35 changed files with 49 additions and 43 deletions
|
@ -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()) {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue