]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix video update transaction
authorChocobozzz <me@florianbigard.com>
Wed, 10 Nov 2021 14:52:22 +0000 (15:52 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 10 Nov 2021 14:52:22 +0000 (15:52 +0100)
server/controllers/api/videos/update.ts
server/models/video/video.ts

index fab1c226848705496455459dabddda16807ca746..a0aa13d71cd87d4d0070a71496709be0b7cddefc 100644 (file)
@@ -104,7 +104,7 @@ export async function updateVideo (req: express.Request, res: express.Response)
 
       // Force updatedAt attribute change
       if (!video.changed()) {
-        await video.setAsRefreshed()
+        await video.setAsRefreshed(t)
       }
 
       const videoInstanceUpdated = await video.save(sequelizeOptions) as MVideoFullLight
index ba4cf541b49615ee63410772bfdce2be17ad2e6f..003741da0c3b8222c9f0cef894cb5597315ff11a 100644 (file)
@@ -1754,8 +1754,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
     return this.hasPrivacyForFederation() === false && isPrivacyForFederation(newPrivacy) === true
   }
 
-  setAsRefreshed () {
-    return setAsUpdated('video', this.id)
+  setAsRefreshed (transaction?: Transaction) {
+    return setAsUpdated('video', this.id, transaction)
   }
 
   requiresAuth () {