aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-06 10:57:40 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commit053aed43fb255b4ae4324a845534f2f562c3b6cc (patch)
tree04cae6af371a1ee869051c67be28acea5581d16d /server/lib/job-queue
parent3bc68dfd6183078fb56b53e24e74f889c85c4ae0 (diff)
downloadPeerTube-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.ts12
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'
10import { VideoLiveModel } from '@server/models/video/video-live' 10import { VideoLiveModel } from '@server/models/video/video-live'
11import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' 11import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
12import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models' 12import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models'
13import { VideoLiveEndingPayload, VideoState } from '@shared/models' 13import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models'
14import { logger } from '../../../helpers/logger' 14import { logger } from '../../../helpers/logger'
15import { generateVideoMiniature } from '@server/lib/thumbnail'
15 16
16async function processVideoLiveEnding (job: Bull.Job) { 17async 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