X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fmodels%2Fserver%2Fjob.model.ts;h=4ab249e0b86eaeb16d88cbba129f2d062869fffb;hb=4d029ef8ec3d5274eeaa3ee6d808eb7035e7faef;hp=61010e5a8682e8762f57d63527f7dc9978817ad7;hpb=2158ac90341dc3fcae958540de65032da25c8d6e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts index 61010e5a8..4ab249e0b 100644 --- a/shared/models/server/job.model.ts +++ b/shared/models/server/job.model.ts @@ -1,13 +1,14 @@ -import { SendEmailOptions } from './emailer.model' -import { VideoResolution } from '@shared/models' import { ContextType } from '../activitypub/context' +import { VideoResolution } from '../videos/video-resolution.enum' +import { SendEmailOptions } from './emailer.model' -export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' +export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused' export type JobType = | 'activitypub-http-unicast' | 'activitypub-http-broadcast' | 'activitypub-http-fetcher' + | 'activitypub-cleaner' | 'activitypub-follow' | 'video-file-import' | 'video-transcoding' @@ -16,12 +17,16 @@ export type JobType = | 'videos-views' | 'activitypub-refresher' | 'video-redundancy' + | 'video-live-ending' + | 'actor-keys' export interface Job { id: number state: JobState type: JobType data: any + priority: number + progress: number error: any createdAt: Date | string finishedOn: Date | string @@ -48,13 +53,12 @@ export type ActivitypubHttpFetcherPayload = { uri: string type: FetchType videoId?: number - accountId?: number } export type ActivitypubHttpUnicastPayload = { uri: string signatureActorId?: number - body: any + body: object contextType?: ContextType } @@ -77,9 +81,6 @@ export type VideoImportYoutubeDLPayload = { type: VideoImportYoutubeDLPayloadType videoImportId: number - generateThumbnail: boolean - generatePreview: boolean - fileExt?: string } export type VideoImportTorrentPayload = { @@ -99,26 +100,27 @@ interface BaseTranscodingPayload { isNewVideo?: boolean } -interface HLSTranscodingPayload extends BaseTranscodingPayload { - type: 'hls' +export interface HLSTranscodingPayload extends BaseTranscodingPayload { + type: 'new-resolution-to-hls' isPortraitMode?: boolean resolution: VideoResolution copyCodecs: boolean + isMaxQuality: boolean } export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload { - type: 'new-resolution' + type: 'new-resolution-to-webtorrent' isPortraitMode?: boolean resolution: VideoResolution } export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { - type: 'merge-audio' + type: 'merge-audio-to-webtorrent' resolution: VideoResolution } export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { - type: 'optimize' + type: 'optimize-to-webtorrent' } export type VideoTranscodingPayload = @@ -126,3 +128,11 @@ export type VideoTranscodingPayload = | NewResolutionTranscodingPayload | OptimizeTranscodingPayload | MergeAudioTranscodingPayload + +export interface VideoLiveEndingPayload { + videoId: number +} + +export interface ActorKeysPayload { + actorId: number +}