aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-state.ts
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/lib/video-state.ts
parent731a32e334fc9eef63a97875d6290ceb34a94ce4 (diff)
downloadPeerTube-9db2330e4a32a3bb0fe821abec1b061e4edb65b5.tar.gz
PeerTube-9db2330e4a32a3bb0fe821abec1b061e4edb65b5.tar.zst
PeerTube-9db2330e4a32a3bb0fe821abec1b061e4edb65b5.zip
Fix notification on create transcoding job
Diffstat (limited to 'server/lib/video-state.ts')
-rw-r--r--server/lib/video-state.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/video-state.ts b/server/lib/video-state.ts
index 0613d94bf..9352a67d1 100644
--- a/server/lib/video-state.ts
+++ b/server/lib/video-state.ts
@@ -70,13 +70,13 @@ async function moveToPublishedState (video: MVideoFullLight, isNewVideo: boolean
70 logger.info('Publishing video %s.', video.uuid, { tags: [ video.uuid ] }) 70 logger.info('Publishing video %s.', video.uuid, { tags: [ video.uuid ] })
71 71
72 const previousState = video.state 72 const previousState = video.state
73 await video.setNewState(VideoState.PUBLISHED, transaction) 73 await video.setNewState(VideoState.PUBLISHED, isNewVideo, transaction)
74 74
75 // If the video was not published, we consider it is a new one for other instances 75 // If the video was not published, we consider it is a new one for other instances
76 // Live videos are always federated, so it's not a new video 76 // Live videos are always federated, so it's not a new video
77 await federateVideoIfNeeded(video, isNewVideo, transaction) 77 await federateVideoIfNeeded(video, isNewVideo, transaction)
78 78
79 Notifier.Instance.notifyOnNewVideoIfNeeded(video) 79 if (isNewVideo) Notifier.Instance.notifyOnNewVideoIfNeeded(video)
80 80
81 if (previousState === VideoState.TO_TRANSCODE) { 81 if (previousState === VideoState.TO_TRANSCODE) {
82 Notifier.Instance.notifyOnVideoPublishedAfterTranscoding(video) 82 Notifier.Instance.notifyOnVideoPublishedAfterTranscoding(video)
@@ -90,7 +90,7 @@ async function moveToExternalStorageState (video: MVideoFullLight, isNewVideo: b
90 // We want to wait all transcoding jobs before moving the video on an external storage 90 // We want to wait all transcoding jobs before moving the video on an external storage
91 if (pendingTranscode !== 0) return 91 if (pendingTranscode !== 0) return
92 92
93 await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, transaction) 93 await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction)
94 94
95 logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] }) 95 logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] })
96 96