-import * as cors from 'cors'
-import * as express from 'express'
+import cors from 'cors'
+import express from 'express'
import { getServerActor } from '@server/models/application/application'
import { MAccountId, MActorId, MChannelId, MVideoId } from '@server/types/models'
import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos'
videosCustomGetValidator,
videosShareValidator
} from '../../middlewares'
-import { cacheRoute } from '../../middlewares/cache'
+import { cacheRoute } from '../../middlewares/cache/cache'
import { getAccountVideoRateValidatorFactory, videoCommentGetValidator } from '../../middlewares/validators'
import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy'
import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists'
// Intercept ActivityPub client requests
activityPubClientRouter.get(
- [ '/accounts?/:name', '/accounts?/:name/video-channels' ],
+ [ '/accounts?/:name', '/accounts?/:name/video-channels', '/a/:name', '/a/:name/video-channels' ],
executeIfActivityPub,
asyncMiddleware(localAccountValidator),
accountController
getAccountVideoRateFactory('dislike')
)
-activityPubClientRouter.get('/videos/watch/:id',
+activityPubClientRouter.get(
+ [ '/videos/watch/:id', '/w/:id' ],
executeIfActivityPub,
- asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.ACTIVITY_PUB.VIDEOS)),
+ cacheRoute(ROUTE_CACHE_LIFETIME.ACTIVITY_PUB.VIDEOS),
asyncMiddleware(videosCustomGetValidator('all')),
asyncMiddleware(videoController)
)
)
activityPubClientRouter.get(
- [ '/video-channels/:name', '/video-channels/:name/videos' ],
+ [ '/video-channels/:name', '/video-channels/:name/videos', '/c/:name', '/c/:name/videos' ],
executeIfActivityPub,
asyncMiddleware(localVideoChannelValidator),
videoChannelController
asyncMiddleware(videoRedundancyController)
)
-activityPubClientRouter.get('/video-playlists/:playlistId',
+activityPubClientRouter.get(
+ [ '/video-playlists/:playlistId', '/videos/watch/playlist/:playlistId', '/w/p/:playlistId' ],
executeIfActivityPub,
asyncMiddleware(videoPlaylistsGetValidator('all')),
asyncMiddleware(videoPlaylistController)