ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

19 lines
628 B

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