You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
main
${ noResults }
19 lines
628 B
TypeScript
19 lines
628 B
TypeScript
import { retryTransactionWrapper } from '@server/helpers/database-utils.js'
|
|||
import { VideoJobInfoModel } from '@server/models/video/video-job-info.js'
|
|||
import { MVideo } from '@server/types/models/index.js'
|
|||
import { moveToNextState } from '../video-state.js'
|
|||
|
|||
export async function onTranscodingEnded (options: {
|
|||
video: MVideo
|
|||
isNewVideo: boolean
|
|||
moveVideoToNextState: boolean
|
|||
}) {
|
|||
const { video, isNewVideo, moveVideoToNextState } = options
|
|||
|
|||
await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscode')
|
|||
|
|||
if (moveVideoToNextState) {
|
|||
await retryTransactionWrapper(moveToNextState, { video, isNewVideo })
|
|||
}
|
|||
}
|