aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-08 15:34:07 +0200
committerChocobozzz <me@florianbigard.com>2021-10-11 09:37:27 +0200
commit9db2330e4a32a3bb0fe821abec1b061e4edb65b5 (patch)
tree32c1a6c80792c50d0fb4aa98429b68c71c8cd365 /server/models/video
parent731a32e334fc9eef63a97875d6290ceb34a94ce4 (diff)
downloadPeerTube-9db2330e4a32a3bb0fe821abec1b061e4edb65b5.tar.gz
PeerTube-9db2330e4a32a3bb0fe821abec1b061e4edb65b5.tar.zst
PeerTube-9db2330e4a32a3bb0fe821abec1b061e4edb65b5.zip
Fix notification on create transcoding job
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video.ts4
1 files changed, 2 insertions, 2 deletions
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<Partial<AttributesOnly<VideoModel>>> {
1766 this.privacy === VideoPrivacy.INTERNAL 1766 this.privacy === VideoPrivacy.INTERNAL
1767 } 1767 }
1768 1768
1769 async setNewState (newState: VideoState, transaction: Transaction) { 1769 async setNewState (newState: VideoState, isNewVideo: boolean, transaction: Transaction) {
1770 if (this.state === newState) throw new Error('Cannot use same state ' + newState) 1770 if (this.state === newState) throw new Error('Cannot use same state ' + newState)
1771 1771
1772 this.state = newState 1772 this.state = newState
1773 1773
1774 if (this.state === VideoState.PUBLISHED) { 1774 if (this.state === VideoState.PUBLISHED && isNewVideo) {
1775 this.publishedAt = new Date() 1775 this.publishedAt = new Date()
1776 } 1776 }
1777 1777