Regenerate storyboard after studio

This commit is contained in:
Chocobozzz 2023-11-29 09:44:25 +01:00
parent 4826cb2c69
commit ba56aadb63
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 26 additions and 7 deletions

View File

@ -236,7 +236,7 @@ const JOB_TTL: { [id in JobType]: number } = {
'activitypub-refresher': 60000 * 10, // 10 minutes
'video-redundancy': 1000 * 3600 * 3, // 3 hours
'video-live-ending': 1000 * 60 * 10, // 10 minutes
'generate-video-storyboard': 1000 * 3600 * 3, // 3 hours
'generate-video-storyboard': 1000 * 3600 * 6, // 6 hours
'manage-video-torrent': 1000 * 3600 * 3, // 3 hours
'move-to-object-storage': 1000 * 60 * 60 * 3, // 3 hours
'move-to-file-system': 1000 * 60 * 60 * 3, // 3 hours

View File

@ -3,14 +3,11 @@ import { join } from 'path'
import { logger, loggerTagsFactory } from '@server/helpers/logger.js'
import { createTorrentAndSetInfoHashFromPath } from '@server/helpers/webtorrent.js'
import { CONFIG } from '@server/initializers/config.js'
import { UserModel } from '@server/models/user/user.js'
import { MUser, MVideo, MVideoFile, MVideoFullLight, MVideoWithAllFiles } from '@server/types/models/index.js'
import { getVideoStreamDuration } from '@peertube/peertube-ffmpeg'
import { VideoStudioEditionPayload, VideoStudioTask, VideoStudioTaskPayload } from '@peertube/peertube-models'
import { federateVideoIfNeeded } from './activitypub/videos/index.js'
import { JobQueue } from './job-queue/index.js'
import { VideoStudioTranscodingJobHandler } from './runners/index.js'
import { createOptimizeOrMergeAudioJobs } from './transcoding/create-transcoding-job.js'
import { getTranscodingJobPriority } from './transcoding/transcoding-priority.js'
import { buildNewFile, removeHLSPlaylist, removeWebVideoFile } from './video-file.js'
import { VideoPathManager } from './video-path-manager.js'
@ -108,11 +105,33 @@ export async function onVideoStudioEnded (options: {
video.duration = await getVideoStreamDuration(outputPath)
await video.save()
await federateVideoIfNeeded(video, false, undefined)
return JobQueue.Instance.createSequentialJobFlow(
{
type: 'generate-video-storyboard' as 'generate-video-storyboard',
payload: {
videoUUID: video.uuid,
federate: false
}
},
const user = await UserModel.loadByVideoId(video.id)
{
type: 'federate-video' as 'federate-video',
payload: {
videoUUID: video.uuid,
isNewVideo: false
}
},
await createOptimizeOrMergeAudioJobs({ video, videoFile: newFile, isNewVideo: false, user, videoFileAlreadyLocked: false })
{
type: 'transcoding-job-builder' as 'transcoding-job-builder',
payload: {
videoUUID: video.uuid,
optimizeJob: {
isNewVideo: false
}
}
}
)
}
// ---------------------------------------------------------------------------