1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Prevent HLS transcoding after webtorrent transcoding

This commit is contained in:
Chocobozzz 2022-02-01 11:16:45 +01:00
parent 3e8c3fcdb0
commit 0f11ec8dd3
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 42 additions and 9 deletions

View file

@ -10,7 +10,7 @@ import { pick } from '@shared/core-utils'
import {
HLSTranscodingPayload,
MergeAudioTranscodingPayload,
NewResolutionTranscodingPayload,
NewWebTorrentResolutionTranscodingPayload,
OptimizeTranscodingPayload,
VideoResolution,
VideoTranscodingPayload
@ -110,7 +110,7 @@ async function handleHLSJob (job: Job, payload: HLSTranscodingPayload, video: MV
async function handleNewWebTorrentResolutionJob (
job: Job,
payload: NewResolutionTranscodingPayload,
payload: NewWebTorrentResolutionTranscodingPayload,
video: MVideoFullLight,
user: MUserId
) {
@ -217,9 +217,12 @@ async function onVideoFirstWebTorrentTranscoding (
async function onNewWebTorrentFileResolution (
video: MVideo,
user: MUserId,
payload: NewResolutionTranscodingPayload | MergeAudioTranscodingPayload
payload: NewWebTorrentResolutionTranscodingPayload | MergeAudioTranscodingPayload
) {
await createHlsJobIfEnabled(user, { hasAudio: true, copyCodecs: true, isMaxQuality: false, ...payload })
if (payload.createHLSIfNeeded) {
await createHlsJobIfEnabled(user, { hasAudio: true, copyCodecs: true, isMaxQuality: false, ...payload })
}
await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode')
await retryTransactionWrapper(moveToNextState, video, payload.isNewVideo)
@ -282,6 +285,7 @@ async function createLowerResolutionsJobs (options: {
resolution,
isPortraitMode,
hasAudio,
createHLSIfNeeded: true,
isNewVideo
}