diff options
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r-- | server/lib/job-queue/handlers/video-file.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/lib/job-queue/handlers/video-file.ts b/server/lib/job-queue/handlers/video-file.ts index ddbf6d1c2..3dca2937f 100644 --- a/server/lib/job-queue/handlers/video-file.ts +++ b/server/lib/job-queue/handlers/video-file.ts | |||
@@ -91,15 +91,15 @@ async function onVideoFileTranscoderOrImportSuccess (video: VideoModel) { | |||
91 | }) | 91 | }) |
92 | } | 92 | } |
93 | 93 | ||
94 | async function onVideoFileOptimizerSuccess (video: VideoModel, isNewVideo: boolean) { | 94 | async function onVideoFileOptimizerSuccess (videoArg: VideoModel, isNewVideo: boolean) { |
95 | if (video === undefined) return undefined | 95 | if (videoArg === undefined) return undefined |
96 | 96 | ||
97 | // Outside the transaction (IO on disk) | 97 | // Outside the transaction (IO on disk) |
98 | const { videoFileResolution } = await video.getOriginalFileResolution() | 98 | const { videoFileResolution } = await videoArg.getOriginalFileResolution() |
99 | 99 | ||
100 | return sequelizeTypescript.transaction(async t => { | 100 | return sequelizeTypescript.transaction(async t => { |
101 | // Maybe the video changed in database, refresh it | 101 | // Maybe the video changed in database, refresh it |
102 | const videoDatabase = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.uuid, t) | 102 | let videoDatabase = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoArg.uuid, t) |
103 | // Video does not exist anymore | 103 | // Video does not exist anymore |
104 | if (!videoDatabase) return undefined | 104 | if (!videoDatabase) return undefined |
105 | 105 | ||
@@ -128,13 +128,13 @@ async function onVideoFileOptimizerSuccess (video: VideoModel, isNewVideo: boole | |||
128 | logger.info('Transcoding jobs created for uuid %s.', videoDatabase.uuid, { resolutionsEnabled }) | 128 | logger.info('Transcoding jobs created for uuid %s.', videoDatabase.uuid, { resolutionsEnabled }) |
129 | } else { | 129 | } else { |
130 | // No transcoding to do, it's now published | 130 | // No transcoding to do, it's now published |
131 | video.state = VideoState.PUBLISHED | 131 | videoDatabase.state = VideoState.PUBLISHED |
132 | video = await video.save({ transaction: t }) | 132 | videoDatabase = await videoDatabase.save({ transaction: t }) |
133 | 133 | ||
134 | logger.info('No transcoding jobs created for video %s (no resolutions).', video.uuid) | 134 | logger.info('No transcoding jobs created for video %s (no resolutions).', videoDatabase.uuid, { privacy: videoDatabase.privacy }) |
135 | } | 135 | } |
136 | 136 | ||
137 | return federateVideoIfNeeded(video, isNewVideo, t) | 137 | return federateVideoIfNeeded(videoDatabase, isNewVideo, t) |
138 | }) | 138 | }) |
139 | } | 139 | } |
140 | 140 | ||