mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Regenerate miniature on live save
This commit is contained in:
parent
3bc68dfd61
commit
053aed43fb
12 changed files with 61 additions and 69 deletions
|
@ -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,6 +110,15 @@ 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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue