aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/videos/update.ts5
-rw-r--r--server/tests/api/videos/multiple-servers.ts20
2 files changed, 25 insertions, 0 deletions
diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts
index a98a3e67c..07f9690ec 100644
--- a/server/controllers/api/videos/update.ts
+++ b/server/controllers/api/videos/update.ts
@@ -99,6 +99,11 @@ export async function updateVideo (req: express.Request, res: express.Response)
99 isNewVideo = await updateVideoPrivacy({ videoInstance, videoInfoToUpdate, hadPrivacyForFederation, transaction: t }) 99 isNewVideo = await updateVideoPrivacy({ videoInstance, videoInfoToUpdate, hadPrivacyForFederation, transaction: t })
100 } 100 }
101 101
102 // Force updatedAt attribute change
103 if (!videoInstance.changed()) {
104 await videoInstance.setAsRefreshed()
105 }
106
102 const videoInstanceUpdated = await videoInstance.save(sequelizeOptions) as MVideoFullLight 107 const videoInstanceUpdated = await videoInstance.save(sequelizeOptions) as MVideoFullLight
103 108
104 // Thumbnail & preview updates? 109 // Thumbnail & preview updates?
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index 470bee45b..c6c279064 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -667,6 +667,26 @@ describe('Test multiple servers', function () {
667 } 667 }
668 }) 668 })
669 669
670 it('Should only update thumbnail and update updatedAt attribute', async function () {
671 this.timeout(10000)
672
673 const attributes = {
674 thumbnailfile: 'thumbnail.jpg'
675 }
676
677 updatedAtMin = new Date()
678 await servers[2].videos.update({ id: toRemove[0].id, attributes })
679
680 await waitJobs(servers)
681
682 for (const server of servers) {
683 const { data } = await server.videos.list()
684
685 const videoUpdated = data.find(video => video.name === 'my super video updated')
686 expect(new Date(videoUpdated.updatedAt)).to.be.greaterThan(updatedAtMin)
687 }
688 })
689
670 it('Should remove the videos 3 and 3-2 by asking server 3 and correctly delete files', async function () { 690 it('Should remove the videos 3 and 3-2 by asking server 3 and correctly delete files', async function () {
671 this.timeout(30000) 691 this.timeout(30000)
672 692