aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r--server/lib/job-queue/handlers/video-file.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/server/lib/job-queue/handlers/video-file.ts b/server/lib/job-queue/handlers/video-file.ts
index 5294483bd..bd9412290 100644
--- a/server/lib/job-queue/handlers/video-file.ts
+++ b/server/lib/job-queue/handlers/video-file.ts
@@ -11,7 +11,8 @@ import { JobQueue } from '../job-queue'
11 11
12export type VideoFilePayload = { 12export type VideoFilePayload = {
13 videoUUID: string 13 videoUUID: string
14 resolution?: VideoResolution 14 resolution?: VideoResolution,
15 isPortraitMode?: boolean
15} 16}
16 17
17async function processVideoFile (job: kue.Job) { 18async function processVideoFile (job: kue.Job) {
@@ -27,7 +28,7 @@ async function processVideoFile (job: kue.Job) {
27 28
28 // Transcoding in other resolution 29 // Transcoding in other resolution
29 if (payload.resolution) { 30 if (payload.resolution) {
30 await video.transcodeOriginalVideofile(payload.resolution) 31 await video.transcodeOriginalVideofile(payload.resolution, payload.isPortraitMode)
31 await onVideoFileTranscoderSuccess(video) 32 await onVideoFileTranscoderSuccess(video)
32 } else { 33 } else {
33 await video.optimizeOriginalVideofile() 34 await video.optimizeOriginalVideofile()
@@ -66,12 +67,12 @@ async function onVideoFileOptimizerSuccess (video: VideoModel) {
66 await shareVideoByServerAndChannel(video, undefined) 67 await shareVideoByServerAndChannel(video, undefined)
67 } 68 }
68 69
69 const originalFileHeight = await videoDatabase.getOriginalFileHeight() 70 const { videoFileResolution } = await videoDatabase.getOriginalFileResolution()
70 71
71 // Create transcoding jobs if there are enabled resolutions 72 // Create transcoding jobs if there are enabled resolutions
72 const resolutionsEnabled = computeResolutionsToTranscode(originalFileHeight) 73 const resolutionsEnabled = computeResolutionsToTranscode(videoFileResolution)
73 logger.info( 74 logger.info(
74 'Resolutions computed for video %s and origin file height of %d.', videoDatabase.uuid, originalFileHeight, 75 'Resolutions computed for video %s and origin file height of %d.', videoDatabase.uuid, videoFileResolution,
75 { resolutions: resolutionsEnabled } 76 { resolutions: resolutionsEnabled }
76 ) 77 )
77 78