diff options
author | Chocobozzz <me@florianbigard.com> | 2021-11-10 15:52:22 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-11-10 15:52:22 +0100 |
commit | 597f771f3f2bfe4b1e7234a5760e23f0283e2b29 (patch) | |
tree | d53c871e886a718c48108be8d99801c195f9069b | |
parent | 7fc1012ffdd1fc06504c8842d4a24826e69a419a (diff) | |
download | PeerTube-597f771f3f2bfe4b1e7234a5760e23f0283e2b29.tar.gz PeerTube-597f771f3f2bfe4b1e7234a5760e23f0283e2b29.tar.zst PeerTube-597f771f3f2bfe4b1e7234a5760e23f0283e2b29.zip |
Fix video update transaction
-rw-r--r-- | server/controllers/api/videos/update.ts | 2 | ||||
-rw-r--r-- | server/models/video/video.ts | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts index fab1c2268..a0aa13d71 100644 --- a/server/controllers/api/videos/update.ts +++ b/server/controllers/api/videos/update.ts | |||
@@ -104,7 +104,7 @@ export async function updateVideo (req: express.Request, res: express.Response) | |||
104 | 104 | ||
105 | // Force updatedAt attribute change | 105 | // Force updatedAt attribute change |
106 | if (!video.changed()) { | 106 | if (!video.changed()) { |
107 | await video.setAsRefreshed() | 107 | await video.setAsRefreshed(t) |
108 | } | 108 | } |
109 | 109 | ||
110 | const videoInstanceUpdated = await video.save(sequelizeOptions) as MVideoFullLight | 110 | const videoInstanceUpdated = await video.save(sequelizeOptions) as MVideoFullLight |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index ba4cf541b..003741da0 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1754,8 +1754,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1754 | return this.hasPrivacyForFederation() === false && isPrivacyForFederation(newPrivacy) === true | 1754 | return this.hasPrivacyForFederation() === false && isPrivacyForFederation(newPrivacy) === true |
1755 | } | 1755 | } |
1756 | 1756 | ||
1757 | setAsRefreshed () { | 1757 | setAsRefreshed (transaction?: Transaction) { |
1758 | return setAsUpdated('video', this.id) | 1758 | return setAsUpdated('video', this.id, transaction) |
1759 | } | 1759 | } |
1760 | 1760 | ||
1761 | requiresAuth () { | 1761 | requiresAuth () { |