diff options
Diffstat (limited to 'server/lib/job-queue/handlers/video-transcoding.ts')
-rw-r--r-- | server/lib/job-queue/handlers/video-transcoding.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index ee241ad03..9c0b1d1f1 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts | |||
@@ -93,7 +93,7 @@ async function handleHLSJob (job: Bull.Job, payload: HLSTranscodingPayload, vide | |||
93 | job | 93 | job |
94 | }) | 94 | }) |
95 | 95 | ||
96 | await retryTransactionWrapper(onHlsPlaylistGeneration, video) | 96 | await retryTransactionWrapper(onHlsPlaylistGeneration, video, payload.resolution) |
97 | } | 97 | } |
98 | 98 | ||
99 | async function handleNewWebTorrentResolutionJob ( | 99 | async function handleNewWebTorrentResolutionJob ( |
@@ -121,11 +121,13 @@ async function handleWebTorrentOptimizeJob (job: Bull.Job, payload: OptimizeTran | |||
121 | 121 | ||
122 | // --------------------------------------------------------------------------- | 122 | // --------------------------------------------------------------------------- |
123 | 123 | ||
124 | async function onHlsPlaylistGeneration (video: MVideoFullLight) { | 124 | async function onHlsPlaylistGeneration (video: MVideoFullLight, resolution: number) { |
125 | if (video === undefined) return undefined | 125 | if (video === undefined) return undefined |
126 | 126 | ||
127 | // We generated the HLS playlist, we don't need the webtorrent files anymore if the admin disabled it | 127 | const maxQualityFile = video.getMaxQualityFile() |
128 | if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false) { | 128 | |
129 | // We generated the max quality HLS playlist, we don't need the webtorrent files anymore if the admin disabled it | ||
130 | if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false && video.hasWebTorrentFiles() && maxQualityFile.resolution === resolution) { | ||
129 | for (const file of video.VideoFiles) { | 131 | for (const file of video.VideoFiles) { |
130 | await video.removeFile(file) | 132 | await video.removeFile(file) |
131 | await file.destroy() | 133 | await file.destroy() |