From 9db2330e4a32a3bb0fe821abec1b061e4edb65b5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 8 Oct 2021 15:34:07 +0200 Subject: Fix notification on create transcoding job --- server/models/video/video.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/models') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index e0c4dd2db..d2daf18ee 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1766,12 +1766,12 @@ export class VideoModel extends Model>> { this.privacy === VideoPrivacy.INTERNAL } - async setNewState (newState: VideoState, transaction: Transaction) { + async setNewState (newState: VideoState, isNewVideo: boolean, transaction: Transaction) { if (this.state === newState) throw new Error('Cannot use same state ' + newState) this.state = newState - if (this.state === VideoState.PUBLISHED) { + if (this.state === VideoState.PUBLISHED && isNewVideo) { this.publishedAt = new Date() } -- cgit v1.2.3