mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Avoir some circular dependencies
This commit is contained in:
parent
7fed637506
commit
8dc8a34ee8
69 changed files with 278 additions and 263 deletions
|
@ -1,9 +1,14 @@
|
|||
import * as Bull from 'bull'
|
||||
import { VideoResolution } from '../../../../shared'
|
||||
import {
|
||||
MergeAudioTranscodingPayload,
|
||||
NewResolutionTranscodingPayload,
|
||||
OptimizeTranscodingPayload,
|
||||
VideoTranscodingPayload
|
||||
} from '../../../../shared'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { VideoModel } from '../../../models/video/video'
|
||||
import { JobQueue } from '../job-queue'
|
||||
import { federateVideoIfNeeded } from '../../activitypub'
|
||||
import { federateVideoIfNeeded } from '../../activitypub/videos'
|
||||
import { retryTransactionWrapper } from '../../../helpers/database-utils'
|
||||
import { sequelizeTypescript } from '../../../initializers'
|
||||
import { computeResolutionsToTranscode } from '../../../helpers/ffmpeg-utils'
|
||||
|
@ -12,39 +17,6 @@ import { Notifier } from '../../notifier'
|
|||
import { CONFIG } from '../../../initializers/config'
|
||||
import { MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/typings/models'
|
||||
|
||||
interface BaseTranscodingPayload {
|
||||
videoUUID: string
|
||||
isNewVideo?: boolean
|
||||
}
|
||||
|
||||
interface HLSTranscodingPayload extends BaseTranscodingPayload {
|
||||
type: 'hls'
|
||||
isPortraitMode?: boolean
|
||||
resolution: VideoResolution
|
||||
copyCodecs: boolean
|
||||
}
|
||||
|
||||
interface NewResolutionTranscodingPayload extends BaseTranscodingPayload {
|
||||
type: 'new-resolution'
|
||||
isPortraitMode?: boolean
|
||||
resolution: VideoResolution
|
||||
}
|
||||
|
||||
interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
|
||||
type: 'merge-audio'
|
||||
resolution: VideoResolution
|
||||
}
|
||||
|
||||
interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
|
||||
type: 'optimize'
|
||||
}
|
||||
|
||||
export type VideoTranscodingPayload =
|
||||
HLSTranscodingPayload
|
||||
| NewResolutionTranscodingPayload
|
||||
| OptimizeTranscodingPayload
|
||||
| MergeAudioTranscodingPayload
|
||||
|
||||
async function processVideoTranscoding (job: Bull.Job) {
|
||||
const payload = job.data as VideoTranscodingPayload
|
||||
logger.info('Processing video file in job %d.', job.id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue