mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
server/server -> server/core
This commit is contained in:
parent
114327d4ce
commit
5a3d0650c9
838 changed files with 111 additions and 111 deletions
18
server/core/lib/transcoding/ended-transcoding.ts
Normal file
18
server/core/lib/transcoding/ended-transcoding.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
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 })
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue