]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/activitypub/client.ts
Fix audio sync after saving replay
[github/Chocobozzz/PeerTube.git] / server / controllers / activitypub / client.ts
index e48641836a3210debfadd7ca33fc60e134390b66..df2a01d2c9a2065bc0d52ee91a8c9f319e31342f 100644 (file)
@@ -35,7 +35,7 @@ import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike'
 import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists'
 import { VideoPlaylistModel } from '../../models/video/video-playlist'
 import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
-import { MAccountId, MActorId, MVideoAPWithoutCaption, MVideoId, MChannelId } from '@server/typings/models'
+import { MAccountId, MActorId, MVideoAPWithoutCaption, MVideoId, MChannelId } from '@server/types/models'
 import { getServerActor } from '@server/models/application/application'
 import { getRateUrl } from '@server/lib/activitypub/video-rates'
 
@@ -159,7 +159,7 @@ activityPubClientRouter.get('/video-playlists/:playlistId',
   asyncMiddleware(videoPlaylistsGetValidator('all')),
   asyncMiddleware(videoPlaylistController)
 )
-activityPubClientRouter.get('/video-playlists/:playlistId/:videoId',
+activityPubClientRouter.get('/video-playlists/:playlistId/videos/:playlistElementId',
   executeIfActivityPub,
   asyncMiddleware(videoPlaylistElementAPGetValidator),
   videoPlaylistElementController
@@ -223,7 +223,7 @@ function getAccountVideoRateFactory (rateType: VideoRateType) {
 
 async function videoController (req: express.Request, res: express.Response) {
   // We need more attributes
-  const video = await VideoModel.loadForGetAPI({ id: res.locals.onlyVideoWithRights.id }) as MVideoAPWithoutCaption
+  const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(res.locals.onlyVideoWithRights.id)
 
   if (video.url.startsWith(WEBSERVER.URL) === false) return res.redirect(video.url)