aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/job-queue/handlers/video-live-ending.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts
index 55bee0b83..d3c84ce75 100644
--- a/server/lib/job-queue/handlers/video-live-ending.ts
+++ b/server/lib/job-queue/handlers/video-live-ending.ts
@@ -89,7 +89,7 @@ async function saveLive (video: MVideo, live: MVideoLive) {
89 hlsPlaylist.VideoFiles = [] 89 hlsPlaylist.VideoFiles = []
90 90
91 const replayFiles = await readdir(replayDirectory) 91 const replayFiles = await readdir(replayDirectory)
92 let duration: number 92 let durationDone: boolean
93 93
94 for (const playlistFile of playlistFiles) { 94 for (const playlistFile of playlistFiles) {
95 const playlistPath = join(replayDirectory, playlistFile) 95 const playlistPath = join(replayDirectory, playlistFile)
@@ -109,9 +109,11 @@ async function saveLive (video: MVideo, live: MVideoLive) {
109 isPortraitMode 109 isPortraitMode
110 }) 110 })
111 111
112 if (!duration) { 112 if (!durationDone) {
113 videoWithFiles.duration = await getDurationFromVideoFile(outputPath) 113 videoWithFiles.duration = await getDurationFromVideoFile(outputPath)
114 await videoWithFiles.save() 114 await videoWithFiles.save()
115
116 durationDone = true
115 } 117 }
116 } 118 }
117 119
@@ -126,7 +128,7 @@ async function saveLive (video: MVideo, live: MVideoLive) {
126 await generateVideoMiniature(videoWithFiles, videoWithFiles.getMaxQualityFile(), ThumbnailType.PREVIEW) 128 await generateVideoMiniature(videoWithFiles, videoWithFiles.getMaxQualityFile(), ThumbnailType.PREVIEW)
127 } 129 }
128 130
129 await publishAndFederateIfNeeded(video, true) 131 await publishAndFederateIfNeeded(videoWithFiles, true)
130} 132}
131 133
132async function cleanupLive (video: MVideo, streamingPlaylist: MStreamingPlaylist) { 134async function cleanupLive (video: MVideo, streamingPlaylist: MStreamingPlaylist) {