aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/job-queue/handlers/video-file-import.ts13
-rw-r--r--server/lib/job-queue/handlers/video-transcoding.ts2
-rw-r--r--server/lib/video-transcoding.ts4
3 files changed, 15 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-file-import.ts b/server/lib/job-queue/handlers/video-file-import.ts
index 582efea3a..cd95aa075 100644
--- a/server/lib/job-queue/handlers/video-file-import.ts
+++ b/server/lib/job-queue/handlers/video-file-import.ts
@@ -23,10 +23,21 @@ async function processVideoFileImport (job: Bull.Job) {
23 return undefined 23 return undefined
24 } 24 }
25 25
26 const data = await getVideoFileResolution(payload.filePath)
27
26 await updateVideoFile(video, payload.filePath) 28 await updateVideoFile(video, payload.filePath)
27 29
28 const user = await UserModel.loadByChannelActorId(video.VideoChannel.actorId) 30 const user = await UserModel.loadByChannelActorId(video.VideoChannel.actorId)
29 await onNewWebTorrentFileResolution(video, user) 31
32 const newResolutionPayload = {
33 type: 'new-resolution-to-webtorrent' as 'new-resolution-to-webtorrent',
34 videoUUID: video.uuid,
35 resolution: data.videoFileResolution,
36 isPortraitMode: data.isPortraitMode,
37 copyCodecs: false,
38 isNewVideo: false
39 }
40 await onNewWebTorrentFileResolution(video, user, newResolutionPayload)
30 41
31 return video 42 return video
32} 43}
diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts
index 853cfebcd..4718a7d5c 100644
--- a/server/lib/job-queue/handlers/video-transcoding.ts
+++ b/server/lib/job-queue/handlers/video-transcoding.ts
@@ -189,7 +189,7 @@ async function onVideoFileOptimizer (
189async function onNewWebTorrentFileResolution ( 189async function onNewWebTorrentFileResolution (
190 video: MVideoUUID, 190 video: MVideoUUID,
191 user: MUserId, 191 user: MUserId,
192 payload?: NewResolutionTranscodingPayload | MergeAudioTranscodingPayload 192 payload: NewResolutionTranscodingPayload | MergeAudioTranscodingPayload
193) { 193) {
194 await publishAndFederateIfNeeded(video) 194 await publishAndFederateIfNeeded(video)
195 195
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts
index d32372fe5..88a6e0673 100644
--- a/server/lib/video-transcoding.ts
+++ b/server/lib/video-transcoding.ts
@@ -334,9 +334,9 @@ async function generateHlsPlaylistCommon (options: {
334 334
335 // Move playlist file 335 // Move playlist file
336 const playlistPath = join(baseHlsDirectory, playlistFilename) 336 const playlistPath = join(baseHlsDirectory, playlistFilename)
337 await move(playlistFileTranscodePath, playlistPath) 337 await move(playlistFileTranscodePath, playlistPath, { overwrite: true })
338 // Move video file 338 // Move video file
339 await move(join(videoTranscodedBasePath, videoFilename), videoFilePath) 339 await move(join(videoTranscodedBasePath, videoFilename), videoFilePath, { overwrite: true })
340 // Cleanup directory 340 // Cleanup directory
341 await remove(videoTranscodedBasePath) 341 await remove(videoTranscodedBasePath)
342 342