aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers/video-live-ending.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-19 16:02:49 +0200
committerChocobozzz <me@florianbigard.com>2023-07-21 17:38:13 +0200
commit12dc3a942a13c7f1489822dae052da197ef15905 (patch)
tree7b87b6be692af0b62ebac17e720c80244fd8a7ec /server/lib/job-queue/handlers/video-live-ending.ts
parentc6867725fb8e3dfbc2018a37ed5a963103587cb6 (diff)
downloadPeerTube-12dc3a942a13c7f1489822dae052da197ef15905.tar.gz
PeerTube-12dc3a942a13c7f1489822dae052da197ef15905.tar.zst
PeerTube-12dc3a942a13c7f1489822dae052da197ef15905.zip
Implement replace file in server side
Diffstat (limited to 'server/lib/job-queue/handlers/video-live-ending.ts')
-rw-r--r--server/lib/job-queue/handlers/video-live-ending.ts20
1 files changed, 2 insertions, 18 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts
index ae886de35..982280b55 100644
--- a/server/lib/job-queue/handlers/video-live-ending.ts
+++ b/server/lib/job-queue/handlers/video-live-ending.ts
@@ -7,7 +7,7 @@ import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url'
7import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' 7import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
8import { cleanupAndDestroyPermanentLive, cleanupTMPLiveFiles, cleanupUnsavedNormalLive } from '@server/lib/live' 8import { cleanupAndDestroyPermanentLive, cleanupTMPLiveFiles, cleanupUnsavedNormalLive } from '@server/lib/live'
9import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '@server/lib/paths' 9import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '@server/lib/paths'
10import { generateLocalVideoMiniature } from '@server/lib/thumbnail' 10import { generateLocalVideoMiniature, regenerateMiniaturesIfNeeded } from '@server/lib/thumbnail'
11import { generateHlsPlaylistResolutionFromTS } from '@server/lib/transcoding/hls-transcoding' 11import { generateHlsPlaylistResolutionFromTS } from '@server/lib/transcoding/hls-transcoding'
12import { VideoPathManager } from '@server/lib/video-path-manager' 12import { VideoPathManager } from '@server/lib/video-path-manager'
13import { moveToNextState } from '@server/lib/video-state' 13import { moveToNextState } from '@server/lib/video-state'
@@ -197,23 +197,7 @@ async function replaceLiveByReplay (options: {
197 } 197 }
198 198
199 // Regenerate the thumbnail & preview? 199 // Regenerate the thumbnail & preview?
200 if (videoWithFiles.getMiniature().automaticallyGenerated === true) { 200 await regenerateMiniaturesIfNeeded(videoWithFiles)
201 const miniature = await generateLocalVideoMiniature({
202 video: videoWithFiles,
203 videoFile: videoWithFiles.getMaxQualityFile(),
204 type: ThumbnailType.MINIATURE
205 })
206 await videoWithFiles.addAndSaveThumbnail(miniature)
207 }
208
209 if (videoWithFiles.getPreview().automaticallyGenerated === true) {
210 const preview = await generateLocalVideoMiniature({
211 video: videoWithFiles,
212 videoFile: videoWithFiles.getMaxQualityFile(),
213 type: ThumbnailType.PREVIEW
214 })
215 await videoWithFiles.addAndSaveThumbnail(preview)
216 }
217 201
218 // We consider this is a new video 202 // We consider this is a new video
219 await moveToNextState({ video: videoWithFiles, isNewVideo: true }) 203 await moveToNextState({ video: videoWithFiles, isNewVideo: true })