2020-04-24 05:33:01 -04:00
|
|
|
import { ContextType } from '../activitypub/context'
|
2022-02-11 04:51:33 -05:00
|
|
|
import { VideoEditorTaskCut } from '../videos/editor'
|
2021-11-18 08:35:08 -05:00
|
|
|
import { VideoResolution } from '../videos/file/video-resolution.enum'
|
2020-08-27 03:58:27 -04:00
|
|
|
import { SendEmailOptions } from './emailer.model'
|
2020-04-23 03:32:53 -04:00
|
|
|
|
2020-12-14 06:00:35 -05:00
|
|
|
export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused'
|
2018-01-25 09:05:18 -05:00
|
|
|
|
2020-01-31 10:56:52 -05:00
|
|
|
export type JobType =
|
|
|
|
| 'activitypub-http-unicast'
|
|
|
|
| 'activitypub-http-broadcast'
|
|
|
|
| 'activitypub-http-fetcher'
|
2021-02-26 10:26:27 -05:00
|
|
|
| 'activitypub-cleaner'
|
2020-01-31 10:56:52 -05:00
|
|
|
| 'activitypub-follow'
|
|
|
|
| 'video-file-import'
|
|
|
|
| 'video-transcoding'
|
|
|
|
| 'email'
|
|
|
|
| 'video-import'
|
2021-11-09 04:11:20 -05:00
|
|
|
| 'videos-views-stats'
|
2020-01-31 10:56:52 -05:00
|
|
|
| 'activitypub-refresher'
|
|
|
|
| 'video-redundancy'
|
2020-09-25 04:04:21 -04:00
|
|
|
| 'video-live-ending'
|
2021-02-26 08:22:25 -05:00
|
|
|
| 'actor-keys'
|
2021-08-17 02:26:20 -04:00
|
|
|
| 'move-to-object-storage'
|
2022-02-11 04:51:33 -05:00
|
|
|
| 'video-edition'
|
2017-11-30 04:51:13 -05:00
|
|
|
|
|
|
|
export interface Job {
|
|
|
|
id: number
|
|
|
|
state: JobState
|
2018-01-25 09:05:18 -05:00
|
|
|
type: JobType
|
2020-01-31 10:56:52 -05:00
|
|
|
data: any
|
2021-01-21 10:57:21 -05:00
|
|
|
priority: number
|
2021-01-21 08:42:43 -05:00
|
|
|
progress: number
|
2020-01-31 10:56:52 -05:00
|
|
|
error: any
|
2019-12-04 08:49:59 -05:00
|
|
|
createdAt: Date | string
|
|
|
|
finishedOn: Date | string
|
|
|
|
processedOn: Date | string
|
2017-11-30 04:51:13 -05:00
|
|
|
}
|
2020-04-23 03:32:53 -04:00
|
|
|
|
|
|
|
export type ActivitypubHttpBroadcastPayload = {
|
|
|
|
uris: string[]
|
|
|
|
signatureActorId?: number
|
|
|
|
body: any
|
|
|
|
contextType?: ContextType
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ActivitypubFollowPayload = {
|
|
|
|
followerActorId: number
|
|
|
|
name: string
|
|
|
|
host: string
|
|
|
|
isAutoFollow?: boolean
|
|
|
|
assertIsChannel?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
|
|
|
|
export type ActivitypubHttpFetcherPayload = {
|
|
|
|
uri: string
|
|
|
|
type: FetchType
|
|
|
|
videoId?: number
|
|
|
|
}
|
|
|
|
|
|
|
|
export type ActivitypubHttpUnicastPayload = {
|
|
|
|
uri: string
|
|
|
|
signatureActorId?: number
|
2021-03-08 08:24:11 -05:00
|
|
|
body: object
|
2020-04-23 03:32:53 -04:00
|
|
|
contextType?: ContextType
|
|
|
|
}
|
|
|
|
|
|
|
|
export type RefreshPayload = {
|
|
|
|
type: 'video' | 'video-playlist' | 'actor'
|
|
|
|
url: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export type EmailPayload = SendEmailOptions
|
|
|
|
|
|
|
|
export type VideoFileImportPayload = {
|
|
|
|
videoUUID: string
|
|
|
|
filePath: string
|
|
|
|
}
|
|
|
|
|
2020-05-14 05:10:26 -04:00
|
|
|
export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
|
|
|
|
export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
|
|
|
|
|
2020-04-23 03:32:53 -04:00
|
|
|
export type VideoImportYoutubeDLPayload = {
|
2020-05-14 05:10:26 -04:00
|
|
|
type: VideoImportYoutubeDLPayloadType
|
2020-04-23 03:32:53 -04:00
|
|
|
videoImportId: number
|
|
|
|
|
|
|
|
fileExt?: string
|
|
|
|
}
|
|
|
|
export type VideoImportTorrentPayload = {
|
2020-05-14 05:10:26 -04:00
|
|
|
type: VideoImportTorrentPayloadType
|
2020-04-23 03:32:53 -04:00
|
|
|
videoImportId: number
|
|
|
|
}
|
|
|
|
export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
|
|
|
|
|
|
|
|
export type VideoRedundancyPayload = {
|
|
|
|
videoId: number
|
|
|
|
}
|
|
|
|
|
|
|
|
// Video transcoding payloads
|
|
|
|
|
|
|
|
interface BaseTranscodingPayload {
|
|
|
|
videoUUID: string
|
|
|
|
isNewVideo?: boolean
|
|
|
|
}
|
|
|
|
|
2021-01-21 09:58:17 -05:00
|
|
|
export interface HLSTranscodingPayload extends BaseTranscodingPayload {
|
|
|
|
type: 'new-resolution-to-hls'
|
2020-04-23 03:32:53 -04:00
|
|
|
resolution: VideoResolution
|
|
|
|
copyCodecs: boolean
|
2021-11-18 08:35:08 -05:00
|
|
|
|
2022-01-06 11:55:37 -05:00
|
|
|
hasAudio: boolean
|
|
|
|
isPortraitMode?: boolean
|
|
|
|
|
2021-11-18 08:35:08 -05:00
|
|
|
autoDeleteWebTorrentIfNeeded: boolean
|
2021-02-08 04:51:10 -05:00
|
|
|
isMaxQuality: boolean
|
2020-04-23 03:32:53 -04:00
|
|
|
}
|
|
|
|
|
2022-02-01 05:16:45 -05:00
|
|
|
export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
|
2021-01-21 09:58:17 -05:00
|
|
|
type: 'new-resolution-to-webtorrent'
|
2020-04-23 03:32:53 -04:00
|
|
|
resolution: VideoResolution
|
2022-01-06 11:55:37 -05:00
|
|
|
|
|
|
|
hasAudio: boolean
|
2022-02-01 05:16:45 -05:00
|
|
|
createHLSIfNeeded: boolean
|
2022-01-06 11:55:37 -05:00
|
|
|
|
|
|
|
isPortraitMode?: boolean
|
2020-04-23 03:32:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
|
2021-01-21 09:58:17 -05:00
|
|
|
type: 'merge-audio-to-webtorrent'
|
2020-04-23 03:32:53 -04:00
|
|
|
resolution: VideoResolution
|
2022-02-01 05:16:45 -05:00
|
|
|
createHLSIfNeeded: true
|
2020-04-23 03:32:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
|
2021-01-21 09:58:17 -05:00
|
|
|
type: 'optimize-to-webtorrent'
|
2020-04-23 03:32:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export type VideoTranscodingPayload =
|
|
|
|
HLSTranscodingPayload
|
2022-02-01 05:16:45 -05:00
|
|
|
| NewWebTorrentResolutionTranscodingPayload
|
2020-04-23 03:32:53 -04:00
|
|
|
| OptimizeTranscodingPayload
|
|
|
|
| MergeAudioTranscodingPayload
|
2020-09-25 04:04:21 -04:00
|
|
|
|
|
|
|
export interface VideoLiveEndingPayload {
|
|
|
|
videoId: number
|
|
|
|
}
|
2021-02-26 08:22:25 -05:00
|
|
|
|
|
|
|
export interface ActorKeysPayload {
|
|
|
|
actorId: number
|
|
|
|
}
|
2021-08-17 02:26:20 -04:00
|
|
|
|
2021-10-25 11:42:20 -04:00
|
|
|
export interface DeleteResumableUploadMetaFilePayload {
|
|
|
|
filepath: string
|
|
|
|
}
|
|
|
|
|
2021-08-17 02:26:20 -04:00
|
|
|
export interface MoveObjectStoragePayload {
|
|
|
|
videoUUID: string
|
|
|
|
isNewVideo: boolean
|
|
|
|
}
|
2022-02-11 04:51:33 -05:00
|
|
|
|
|
|
|
export type VideoEditorTaskCutPayload = VideoEditorTaskCut
|
|
|
|
|
|
|
|
export type VideoEditorTaskIntroPayload = {
|
|
|
|
name: 'add-intro'
|
|
|
|
|
|
|
|
options: {
|
|
|
|
file: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export type VideoEditorTaskOutroPayload = {
|
|
|
|
name: 'add-outro'
|
|
|
|
|
|
|
|
options: {
|
|
|
|
file: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export type VideoEditorTaskWatermarkPayload = {
|
|
|
|
name: 'add-watermark'
|
|
|
|
|
|
|
|
options: {
|
|
|
|
file: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export type VideoEditionTaskPayload =
|
|
|
|
VideoEditorTaskCutPayload |
|
|
|
|
VideoEditorTaskIntroPayload |
|
|
|
|
VideoEditorTaskOutroPayload |
|
|
|
|
VideoEditorTaskWatermarkPayload
|
|
|
|
|
|
|
|
export interface VideoEditionPayload {
|
|
|
|
videoUUID: string
|
|
|
|
tasks: VideoEditionTaskPayload[]
|
|
|
|
}
|