aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-17 16:39:32 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-19 11:30:21 +0200
commit371906639ee9b6ea4daae504bc7c2b15856c3f38 (patch)
treea1807d7e5648a8b99565cc22daa22a1afbb34db4 /server/controllers/api
parentb75410b87d889ae5b1704cc7f9d32a3792db9075 (diff)
downloadPeerTube-371906639ee9b6ea4daae504bc7c2b15856c3f38.tar.gz
PeerTube-371906639ee9b6ea4daae504bc7c2b15856c3f38.tar.zst
PeerTube-371906639ee9b6ea4daae504bc7c2b15856c3f38.zip
Add ability to a video multiple times in a playlist
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/video-playlist.ts4
1 files changed, 3 insertions, 1 deletions
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