aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-studio-edition.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/job-queue/handlers/video-studio-edition.ts')
-rw-r--r--server/lib/job-queue/handlers/video-studio-edition.ts18
1 files changed, 6 insertions, 12 deletions
diff --git a/server/lib/job-queue/handlers/video-studio-edition.ts b/server/lib/job-queue/handlers/video-studio-edition.ts
index 434d0ffe8..735150d57 100644
--- a/server/lib/job-queue/handlers/video-studio-edition.ts
+++ b/server/lib/job-queue/handlers/video-studio-edition.ts
@@ -9,6 +9,7 @@ import { generateWebTorrentVideoFilename } from '@server/lib/paths'
9import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/default-transcoding-profiles' 9import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/default-transcoding-profiles'
10import { isAbleToUploadVideo } from '@server/lib/user' 10import { isAbleToUploadVideo } from '@server/lib/user'
11import { addOptimizeOrMergeAudioJob } from '@server/lib/video' 11import { addOptimizeOrMergeAudioJob } from '@server/lib/video'
12import { removeHLSPlaylist, removeWebTorrentFile } from '@server/lib/video-file'
12import { VideoPathManager } from '@server/lib/video-path-manager' 13import { VideoPathManager } from '@server/lib/video-path-manager'
13import { approximateIntroOutroAdditionalSize } from '@server/lib/video-studio' 14import { approximateIntroOutroAdditionalSize } from '@server/lib/video-studio'
14import { UserModel } from '@server/models/user/user' 15import { UserModel } from '@server/models/user/user'
@@ -27,12 +28,12 @@ import {
27} from '@shared/extra-utils' 28} from '@shared/extra-utils'
28import { 29import {
29 VideoStudioEditionPayload, 30 VideoStudioEditionPayload,
30 VideoStudioTaskPayload, 31 VideoStudioTask,
31 VideoStudioTaskCutPayload, 32 VideoStudioTaskCutPayload,
32 VideoStudioTaskIntroPayload, 33 VideoStudioTaskIntroPayload,
33 VideoStudioTaskOutroPayload, 34 VideoStudioTaskOutroPayload,
34 VideoStudioTaskWatermarkPayload, 35 VideoStudioTaskPayload,
35 VideoStudioTask 36 VideoStudioTaskWatermarkPayload
36} from '@shared/models' 37} from '@shared/models'
37import { logger, loggerTagsFactory } from '../../../helpers/logger' 38import { logger, loggerTagsFactory } from '../../../helpers/logger'
38 39
@@ -89,7 +90,6 @@ async function processVideoStudioEdition (job: Job) {
89 await move(editionResultPath, outputPath) 90 await move(editionResultPath, outputPath)
90 91
91 await createTorrentAndSetInfoHashFromPath(video, newFile, outputPath) 92 await createTorrentAndSetInfoHashFromPath(video, newFile, outputPath)
92
93 await removeAllFiles(video, newFile) 93 await removeAllFiles(video, newFile)
94 94
95 await newFile.save() 95 await newFile.save()
@@ -197,18 +197,12 @@ async function buildNewFile (video: MVideoId, path: string) {
197} 197}
198 198
199async function removeAllFiles (video: MVideoWithAllFiles, webTorrentFileException: MVideoFile) { 199async function removeAllFiles (video: MVideoWithAllFiles, webTorrentFileException: MVideoFile) {
200 const hls = video.getHLSPlaylist() 200 await removeHLSPlaylist(video)
201
202 if (hls) {
203 await video.removeStreamingPlaylistFiles(hls)
204 await hls.destroy()
205 }
206 201
207 for (const file of video.VideoFiles) { 202 for (const file of video.VideoFiles) {
208 if (file.id === webTorrentFileException.id) continue 203 if (file.id === webTorrentFileException.id) continue
209 204
210 await video.removeWebTorrentFileAndTorrent(file) 205 await removeWebTorrentFile(video, file.id)
211 await file.destroy()
212 } 206 }
213} 207}
214 208