X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fjob-queue%2Fhandlers%2Fvideo-live-ending.ts;h=55c7a4ccbc84dc74bdf331e1e702bba8ef213ac6;hb=529f037294d9917a62235f8162887a8edc04c32f;hp=3892260c46ca6c3ee827c9a71206e445e06725de;hpb=3bc68dfd6183078fb56b53e24e74f889c85c4ae0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts index 3892260c4..55c7a4ccb 100644 --- a/server/lib/job-queue/handlers/video-live-ending.ts +++ b/server/lib/job-queue/handlers/video-live-ending.ts @@ -10,8 +10,9 @@ import { VideoFileModel } from '@server/models/video/video-file' import { VideoLiveModel } from '@server/models/video/video-live' import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' -import { VideoLiveEndingPayload, VideoState } from '@shared/models' +import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' import { logger } from '../../../helpers/logger' +import { generateVideoMiniature } from '@server/lib/thumbnail' async function processVideoLiveEnding (job: Bull.Job) { const payload = job.data as VideoLiveEndingPayload @@ -109,11 +110,20 @@ async function saveLive (video: MVideo, live: MVideoLive) { await remove(videoInputPath) } + // Regenerate the thumbnail & preview? + if (videoWithFiles.getMiniature().automaticallyGenerated === true) { + await generateVideoMiniature(videoWithFiles, videoWithFiles.getMaxQualityFile(), ThumbnailType.MINIATURE) + } + + if (videoWithFiles.getPreview().automaticallyGenerated === true) { + await generateVideoMiniature(videoWithFiles, videoWithFiles.getMaxQualityFile(), ThumbnailType.PREVIEW) + } + await publishAndFederateIfNeeded(video, true) } async function cleanupLive (video: MVideo, streamingPlaylist: MStreamingPlaylist) { - const hlsDirectory = getHLSDirectory(video, false) + const hlsDirectory = getHLSDirectory(video) await remove(hlsDirectory)