diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-06 10:57:40 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | 053aed43fb255b4ae4324a845534f2f562c3b6cc (patch) | |
tree | 04cae6af371a1ee869051c67be28acea5581d16d /server/lib/job-queue | |
parent | 3bc68dfd6183078fb56b53e24e74f889c85c4ae0 (diff) | |
download | PeerTube-053aed43fb255b4ae4324a845534f2f562c3b6cc.tar.gz PeerTube-053aed43fb255b4ae4324a845534f2f562c3b6cc.tar.zst PeerTube-053aed43fb255b4ae4324a845534f2f562c3b6cc.zip |
Regenerate miniature on live save
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r-- | server/lib/job-queue/handlers/video-live-ending.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts index 3892260c4..3d9341738 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' | |||
10 | import { VideoLiveModel } from '@server/models/video/video-live' | 10 | import { VideoLiveModel } from '@server/models/video/video-live' |
11 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' | 11 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' |
12 | import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' | 12 | import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' |
13 | import { VideoLiveEndingPayload, VideoState } from '@shared/models' | 13 | import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models' |
14 | import { logger } from '../../../helpers/logger' | 14 | import { logger } from '../../../helpers/logger' |
15 | import { generateVideoMiniature } from '@server/lib/thumbnail' | ||
15 | 16 | ||
16 | async function processVideoLiveEnding (job: Bull.Job) { | 17 | async function processVideoLiveEnding (job: Bull.Job) { |
17 | const payload = job.data as VideoLiveEndingPayload | 18 | const payload = job.data as VideoLiveEndingPayload |
@@ -109,6 +110,15 @@ async function saveLive (video: MVideo, live: MVideoLive) { | |||
109 | await remove(videoInputPath) | 110 | await remove(videoInputPath) |
110 | } | 111 | } |
111 | 112 | ||
113 | // Regenerate the thumbnail & preview? | ||
114 | if (videoWithFiles.getMiniature().automaticallyGenerated === true) { | ||
115 | await generateVideoMiniature(videoWithFiles, videoWithFiles.getMaxQualityFile(), ThumbnailType.MINIATURE) | ||
116 | } | ||
117 | |||
118 | if (videoWithFiles.getPreview().automaticallyGenerated === true) { | ||
119 | await generateVideoMiniature(videoWithFiles, videoWithFiles.getMaxQualityFile(), ThumbnailType.PREVIEW) | ||
120 | } | ||
121 | |||
112 | await publishAndFederateIfNeeded(video, true) | 122 | await publishAndFederateIfNeeded(video, true) |
113 | } | 123 | } |
114 | 124 | ||