From efa3fef23ecf4e1c5289f8715de184c272ea49f7 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/lib/video-state.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/video-state.ts') 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 logger.info('Publishing video %s.', video.uuid, { tags: [ video.uuid ] }) const previousState = video.state - await video.setNewState(VideoState.PUBLISHED, transaction) + await video.setNewState(VideoState.PUBLISHED, isNewVideo, transaction) // If the video was not published, we consider it is a new one for other instances // Live videos are always federated, so it's not a new video await federateVideoIfNeeded(video, isNewVideo, transaction) - Notifier.Instance.notifyOnNewVideoIfNeeded(video) + if (isNewVideo) Notifier.Instance.notifyOnNewVideoIfNeeded(video) if (previousState === VideoState.TO_TRANSCODE) { Notifier.Instance.notifyOnVideoPublishedAfterTranscoding(video) @@ -90,7 +90,7 @@ async function moveToExternalStorageState (video: MVideoFullLight, isNewVideo: b // We want to wait all transcoding jobs before moving the video on an external storage if (pendingTranscode !== 0) return - await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, transaction) + await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction) logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] }) -- cgit v1.2.3