1 import { ContextType } from '../activitypub/context'
2 import { VideoResolution } from '../videos/video-resolution.enum'
3 import { SendEmailOptions } from './emailer.model'
5 export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused'
8 | 'activitypub-http-unicast'
9 | 'activitypub-http-broadcast'
10 | 'activitypub-http-fetcher'
11 | 'activitypub-follow'
17 | 'activitypub-refresher'
21 export interface Job {
29 createdAt: Date | string
30 finishedOn: Date | string
31 processedOn: Date | string
34 export type ActivitypubHttpBroadcastPayload = {
36 signatureActorId?: number
38 contextType?: ContextType
41 export type ActivitypubFollowPayload = {
42 followerActorId: number
45 isAutoFollow?: boolean
46 assertIsChannel?: boolean
49 export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
50 export type ActivitypubHttpFetcherPayload = {
57 export type ActivitypubHttpUnicastPayload = {
59 signatureActorId?: number
61 contextType?: ContextType
64 export type RefreshPayload = {
65 type: 'video' | 'video-playlist' | 'actor'
69 export type EmailPayload = SendEmailOptions
71 export type VideoFileImportPayload = {
76 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
77 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
79 export type VideoImportYoutubeDLPayload = {
80 type: VideoImportYoutubeDLPayloadType
83 generateThumbnail: boolean
84 generatePreview: boolean
87 export type VideoImportTorrentPayload = {
88 type: VideoImportTorrentPayloadType
91 export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
93 export type VideoRedundancyPayload = {
97 // Video transcoding payloads
99 interface BaseTranscodingPayload {
104 export interface HLSTranscodingPayload extends BaseTranscodingPayload {
105 type: 'new-resolution-to-hls'
106 isPortraitMode?: boolean
107 resolution: VideoResolution
111 export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload {
112 type: 'new-resolution-to-webtorrent'
113 isPortraitMode?: boolean
114 resolution: VideoResolution
117 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
118 type: 'merge-audio-to-webtorrent'
119 resolution: VideoResolution
122 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
123 type: 'optimize-to-webtorrent'
126 export type VideoTranscodingPayload =
127 HLSTranscodingPayload
128 | NewResolutionTranscodingPayload
129 | OptimizeTranscodingPayload
130 | MergeAudioTranscodingPayload
132 export interface VideoLiveEndingPayload {