1 import { retryTransactionWrapper } from '@server/helpers/database-utils'
2 import { VideoJobInfoModel } from '@server/models/video/video-job-info'
3 import { MVideo } from '@server/types/models'
4 import { moveToNextState } from '../video-state'
6 export async function onTranscodingEnded (options: {
9 moveVideoToNextState: boolean
11 const { video, isNewVideo, moveVideoToNextState } = options
13 await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode')
15 if (moveVideoToNextState) {
16 await retryTransactionWrapper(moveToNextState, { video, isNewVideo })