aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/video-playlist.ts6
-rw-r--r--server/models/video/video-playlist-element.ts1
2 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts
index 2f81cf43c..2347e18d2 100644
--- a/server/controllers/api/video-playlist.ts
+++ b/server/controllers/api/video-playlist.ts
@@ -376,7 +376,7 @@ async function removeVideoFromPlaylist (req: express.Request, res: express.Respo
376 await videoPlaylistElement.destroy({ transaction: t }) 376 await videoPlaylistElement.destroy({ transaction: t })
377 377
378 // Decrease position of the next elements 378 // Decrease position of the next elements
379 await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, positionToDelete, null, -1, t) 379 await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, positionToDelete, -1, t)
380 380
381 videoPlaylist.changed('updatedAt', true) 381 videoPlaylist.changed('updatedAt', true)
382 await videoPlaylist.save({ transaction: t }) 382 await videoPlaylist.save({ transaction: t })
@@ -415,7 +415,7 @@ async function reorderVideosPlaylist (req: express.Request, res: express.Respons
415 const newPosition = insertAfter + 1 415 const newPosition = insertAfter + 1
416 416
417 // Add space after the position when we want to insert our reordered elements (increase) 417 // Add space after the position when we want to insert our reordered elements (increase)
418 await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, newPosition, null, reorderLength, t) 418 await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, newPosition, reorderLength, t)
419 419
420 let oldPosition = start 420 let oldPosition = start
421 421
@@ -427,7 +427,7 @@ async function reorderVideosPlaylist (req: express.Request, res: express.Respons
427 await VideoPlaylistElementModel.reassignPositionOf(videoPlaylist.id, oldPosition, endOldPosition, newPosition, t) 427 await VideoPlaylistElementModel.reassignPositionOf(videoPlaylist.id, oldPosition, endOldPosition, newPosition, t)
428 428
429 // Decrease positions of elements after the old position of our ordered elements (decrease) 429 // Decrease positions of elements after the old position of our ordered elements (decrease)
430 await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, oldPosition, null, -reorderLength, t) 430 await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, oldPosition, -reorderLength, t)
431 431
432 videoPlaylist.changed('updatedAt', true) 432 videoPlaylist.changed('updatedAt', true)
433 await videoPlaylist.save({ transaction: t }) 433 await videoPlaylist.save({ transaction: t })
diff --git a/server/models/video/video-playlist-element.ts b/server/models/video/video-playlist-element.ts
index e6906cb19..82c832188 100644
--- a/server/models/video/video-playlist-element.ts
+++ b/server/models/video/video-playlist-element.ts
@@ -282,7 +282,6 @@ export class VideoPlaylistElementModel extends Model<Partial<AttributesOnly<Vide
282 static increasePositionOf ( 282 static increasePositionOf (
283 videoPlaylistId: number, 283 videoPlaylistId: number,
284 fromPosition: number, 284 fromPosition: number,
285 toPosition?: number,
286 by = 1, 285 by = 1,
287 transaction?: Transaction 286 transaction?: Transaction
288 ) { 287 ) {