mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Add playlist updatedAt tests
This commit is contained in:
parent
76564702b7
commit
2a10aab3d7
3 changed files with 39 additions and 6 deletions
|
@ -292,7 +292,7 @@ async function addVideoInPlaylist (req: express.Request, res: express.Response)
|
|||
videoId: video.id
|
||||
}, { transaction: t })
|
||||
|
||||
videoPlaylist.updatedAt = new Date()
|
||||
videoPlaylist.changed('updatedAt', true)
|
||||
await videoPlaylist.save({ transaction: t })
|
||||
|
||||
await sendUpdateVideoPlaylist(videoPlaylist, t)
|
||||
|
@ -332,7 +332,7 @@ async function updateVideoPlaylistElement (req: express.Request, res: express.Re
|
|||
|
||||
const element = await videoPlaylistElement.save({ transaction: t })
|
||||
|
||||
videoPlaylist.updatedAt = new Date()
|
||||
videoPlaylist.changed('updatedAt', true)
|
||||
await videoPlaylist.save({ transaction: t })
|
||||
|
||||
await sendUpdateVideoPlaylist(videoPlaylist, t)
|
||||
|
@ -356,7 +356,7 @@ async function removeVideoFromPlaylist (req: express.Request, res: express.Respo
|
|||
// Decrease position of the next elements
|
||||
await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, positionToDelete, null, -1, t)
|
||||
|
||||
videoPlaylist.updatedAt = new Date()
|
||||
videoPlaylist.changed('updatedAt', true)
|
||||
await videoPlaylist.save({ transaction: t })
|
||||
|
||||
await sendUpdateVideoPlaylist(videoPlaylist, t)
|
||||
|
@ -401,7 +401,7 @@ async function reorderVideosPlaylist (req: express.Request, res: express.Respons
|
|||
// Decrease positions of elements after the old position of our ordered elements (decrease)
|
||||
await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, oldPosition, null, -reorderLength, t)
|
||||
|
||||
videoPlaylist.updatedAt = new Date()
|
||||
videoPlaylist.changed('updatedAt', true)
|
||||
await videoPlaylist.save({ transaction: t })
|
||||
|
||||
await sendUpdateVideoPlaylist(videoPlaylist, t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue