aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-01 11:16:45 +0100
committerChocobozzz <me@florianbigard.com>2022-02-01 11:27:38 +0100
commit0f11ec8dd32b50897c18588db948e96cf0fc2c70 (patch)
tree49be9328b4dd5ac8d989ccbe157f494d85246618 /server/lib
parent3e8c3fcdb063e2d8f4b3ba04fdcdeda588538751 (diff)
downloadPeerTube-0f11ec8dd32b50897c18588db948e96cf0fc2c70.tar.gz
PeerTube-0f11ec8dd32b50897c18588db948e96cf0fc2c70.tar.zst
PeerTube-0f11ec8dd32b50897c18588db948e96cf0fc2c70.zip
Prevent HLS transcoding after webtorrent transcoding
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/job-queue/handlers/video-transcoding.ts12
-rw-r--r--server/lib/video.ts1
2 files changed, 9 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts
index 02902b0b8..5540b791d 100644
--- a/server/lib/job-queue/handlers/video-transcoding.ts
+++ b/server/lib/job-queue/handlers/video-transcoding.ts
@@ -10,7 +10,7 @@ import { pick } from '@shared/core-utils'
10import { 10import {
11 HLSTranscodingPayload, 11 HLSTranscodingPayload,
12 MergeAudioTranscodingPayload, 12 MergeAudioTranscodingPayload,
13 NewResolutionTranscodingPayload, 13 NewWebTorrentResolutionTranscodingPayload,
14 OptimizeTranscodingPayload, 14 OptimizeTranscodingPayload,
15 VideoResolution, 15 VideoResolution,
16 VideoTranscodingPayload 16 VideoTranscodingPayload
@@ -110,7 +110,7 @@ async function handleHLSJob (job: Job, payload: HLSTranscodingPayload, video: MV
110 110
111async function handleNewWebTorrentResolutionJob ( 111async function handleNewWebTorrentResolutionJob (
112 job: Job, 112 job: Job,
113 payload: NewResolutionTranscodingPayload, 113 payload: NewWebTorrentResolutionTranscodingPayload,
114 video: MVideoFullLight, 114 video: MVideoFullLight,
115 user: MUserId 115 user: MUserId
116) { 116) {
@@ -217,9 +217,12 @@ async function onVideoFirstWebTorrentTranscoding (
217async function onNewWebTorrentFileResolution ( 217async function onNewWebTorrentFileResolution (
218 video: MVideo, 218 video: MVideo,
219 user: MUserId, 219 user: MUserId,
220 payload: NewResolutionTranscodingPayload | MergeAudioTranscodingPayload 220 payload: NewWebTorrentResolutionTranscodingPayload | MergeAudioTranscodingPayload
221) { 221) {
222 await createHlsJobIfEnabled(user, { hasAudio: true, copyCodecs: true, isMaxQuality: false, ...payload }) 222 if (payload.createHLSIfNeeded) {
223 await createHlsJobIfEnabled(user, { hasAudio: true, copyCodecs: true, isMaxQuality: false, ...payload })
224 }
225
223 await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode') 226 await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode')
224 227
225 await retryTransactionWrapper(moveToNextState, video, payload.isNewVideo) 228 await retryTransactionWrapper(moveToNextState, video, payload.isNewVideo)
@@ -282,6 +285,7 @@ async function createLowerResolutionsJobs (options: {
282 resolution, 285 resolution,
283 isPortraitMode, 286 isPortraitMode,
284 hasAudio, 287 hasAudio,
288 createHLSIfNeeded: true,
285 isNewVideo 289 isNewVideo
286 } 290 }
287 291
diff --git a/server/lib/video.ts b/server/lib/video.ts
index e5af028ea..2690f953d 100644
--- a/server/lib/video.ts
+++ b/server/lib/video.ts
@@ -89,6 +89,7 @@ async function addOptimizeOrMergeAudioJob (video: MVideoUUID, videoFile: MVideoF
89 type: 'merge-audio-to-webtorrent', 89 type: 'merge-audio-to-webtorrent',
90 resolution: DEFAULT_AUDIO_RESOLUTION, 90 resolution: DEFAULT_AUDIO_RESOLUTION,
91 videoUUID: video.uuid, 91 videoUUID: video.uuid,
92 createHLSIfNeeded: true,
92 isNewVideo: true 93 isNewVideo: true
93 } 94 }
94 } else { 95 } else {