]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/activitypub/client.ts
Fix sequelize order typings
[github/Chocobozzz/PeerTube.git] / server / controllers / activitypub / client.ts
index f592af644e35fda6d4602e1ffbf8dc55b1e792e7..c4e3cec6b4833da1a0effda48acee07f89cb008b 100644 (file)
@@ -1,5 +1,5 @@
-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'
@@ -24,7 +24,7 @@ import {
   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'
@@ -43,7 +43,7 @@ activityPubClientRouter.use(cors())
 // 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
@@ -74,9 +74,10 @@ activityPubClientRouter.get('/accounts?/:name/dislikes/:videoId',
   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)
 )
@@ -122,7 +123,7 @@ activityPubClientRouter.get('/videos/watch/:videoId/comments/:commentId/activity
 )
 
 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
@@ -154,7 +155,8 @@ activityPubClientRouter.get('/redundancy/streaming-playlists/:streamingPlaylistT
   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)