diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/activitypub/client.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/video-playlist.ts | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index acce53713..1da44d096 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts | |||
@@ -159,7 +159,7 @@ activityPubClientRouter.get('/video-playlists/:playlistId', | |||
159 | asyncMiddleware(videoPlaylistsGetValidator('all')), | 159 | asyncMiddleware(videoPlaylistsGetValidator('all')), |
160 | asyncMiddleware(videoPlaylistController) | 160 | asyncMiddleware(videoPlaylistController) |
161 | ) | 161 | ) |
162 | activityPubClientRouter.get('/video-playlists/:playlistId/:videoId', | 162 | activityPubClientRouter.get('/video-playlists/:playlistId/videos/:playlistElementId', |
163 | executeIfActivityPub, | 163 | executeIfActivityPub, |
164 | asyncMiddleware(videoPlaylistElementAPGetValidator), | 164 | asyncMiddleware(videoPlaylistElementAPGetValidator), |
165 | videoPlaylistElementController | 165 | videoPlaylistElementController |
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index 88a2314fb..41a0e07ff 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts | |||
@@ -297,7 +297,6 @@ async function addVideoInPlaylist (req: express.Request, res: express.Response) | |||
297 | const position = await VideoPlaylistElementModel.getNextPositionOf(videoPlaylist.id, t) | 297 | const position = await VideoPlaylistElementModel.getNextPositionOf(videoPlaylist.id, t) |
298 | 298 | ||
299 | const playlistElement = await VideoPlaylistElementModel.create({ | 299 | const playlistElement = await VideoPlaylistElementModel.create({ |
300 | url: getVideoPlaylistElementActivityPubUrl(videoPlaylist, video), | ||
301 | position, | 300 | position, |
302 | startTimestamp: body.startTimestamp || null, | 301 | startTimestamp: body.startTimestamp || null, |
303 | stopTimestamp: body.stopTimestamp || null, | 302 | stopTimestamp: body.stopTimestamp || null, |
@@ -305,6 +304,9 @@ async function addVideoInPlaylist (req: express.Request, res: express.Response) | |||
305 | videoId: video.id | 304 | videoId: video.id |
306 | }, { transaction: t }) | 305 | }, { transaction: t }) |
307 | 306 | ||
307 | playlistElement.url = getVideoPlaylistElementActivityPubUrl(videoPlaylist, playlistElement) | ||
308 | await playlistElement.save({ transaction: t }) | ||
309 | |||
308 | videoPlaylist.changed('updatedAt', true) | 310 | videoPlaylist.changed('updatedAt', true) |
309 | await videoPlaylist.save({ transaction: t }) | 311 | await videoPlaylist.save({ transaction: t }) |
310 | 312 | ||