From 371906639ee9b6ea4daae504bc7c2b15856c3f38 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Aug 2020 16:39:32 +0200 Subject: Add ability to a video multiple times in a playlist --- server/controllers/api/video-playlist.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/controllers/api') 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) const position = await VideoPlaylistElementModel.getNextPositionOf(videoPlaylist.id, t) const playlistElement = await VideoPlaylistElementModel.create({ - url: getVideoPlaylistElementActivityPubUrl(videoPlaylist, video), position, startTimestamp: body.startTimestamp || null, stopTimestamp: body.stopTimestamp || null, @@ -305,6 +304,9 @@ async function addVideoInPlaylist (req: express.Request, res: express.Response) videoId: video.id }, { transaction: t }) + playlistElement.url = getVideoPlaylistElementActivityPubUrl(videoPlaylist, playlistElement) + await playlistElement.save({ transaction: t }) + videoPlaylist.changed('updatedAt', true) await videoPlaylist.save({ transaction: t }) -- cgit v1.2.3