diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-19 16:02:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-21 17:38:13 +0200 |
commit | 12dc3a942a13c7f1489822dae052da197ef15905 (patch) | |
tree | 7b87b6be692af0b62ebac17e720c80244fd8a7ec /server/lib/job-queue/handlers/video-live-ending.ts | |
parent | c6867725fb8e3dfbc2018a37ed5a963103587cb6 (diff) | |
download | PeerTube-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.ts | 20 |
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' | |||
7 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' | 7 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' |
8 | import { cleanupAndDestroyPermanentLive, cleanupTMPLiveFiles, cleanupUnsavedNormalLive } from '@server/lib/live' | 8 | import { cleanupAndDestroyPermanentLive, cleanupTMPLiveFiles, cleanupUnsavedNormalLive } from '@server/lib/live' |
9 | import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '@server/lib/paths' | 9 | import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '@server/lib/paths' |
10 | import { generateLocalVideoMiniature } from '@server/lib/thumbnail' | 10 | import { generateLocalVideoMiniature, regenerateMiniaturesIfNeeded } from '@server/lib/thumbnail' |
11 | import { generateHlsPlaylistResolutionFromTS } from '@server/lib/transcoding/hls-transcoding' | 11 | import { generateHlsPlaylistResolutionFromTS } from '@server/lib/transcoding/hls-transcoding' |
12 | import { VideoPathManager } from '@server/lib/video-path-manager' | 12 | import { VideoPathManager } from '@server/lib/video-path-manager' |
13 | import { moveToNextState } from '@server/lib/video-state' | 13 | import { 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 }) |