]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/models/server/job.model.ts
Update translations
[github/Chocobozzz/PeerTube.git] / shared / models / server / job.model.ts
CommitLineData
e307e4fc 1import { ContextType } from '../activitypub/context'
ad5db104 2import { VideoResolution } from '../videos/file/video-resolution.enum'
0fecf427 3import { SendEmailOptions } from './emailer.model'
8dc8a34e 4
402145b8 5export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused'
94a5ff8a 6
a1587156
C
7export type JobType =
8 | 'activitypub-http-unicast'
9 | 'activitypub-http-broadcast'
10 | 'activitypub-http-fetcher'
74d249bc 11 | 'activitypub-cleaner'
a1587156
C
12 | 'activitypub-follow'
13 | 'video-file-import'
14 | 'video-transcoding'
15 | 'email'
16 | 'video-import'
51353d9a 17 | 'videos-views-stats'
a1587156
C
18 | 'activitypub-refresher'
19 | 'video-redundancy'
a5cf76af 20 | 'video-live-ending'
8795d6f2 21 | 'actor-keys'
0305db28 22 | 'move-to-object-storage'
5cd80545
C
23
24export interface Job {
25 id: number
26 state: JobState
94a5ff8a 27 type: JobType
a1587156 28 data: any
77d7e851 29 priority: number
3b01f4c0 30 progress: number
a1587156 31 error: any
1061c73f
C
32 createdAt: Date | string
33 finishedOn: Date | string
34 processedOn: Date | string
5cd80545 35}
8dc8a34e
C
36
37export type ActivitypubHttpBroadcastPayload = {
38 uris: string[]
39 signatureActorId?: number
40 body: any
41 contextType?: ContextType
42}
43
44export type ActivitypubFollowPayload = {
45 followerActorId: number
46 name: string
47 host: string
48 isAutoFollow?: boolean
49 assertIsChannel?: boolean
50}
51
52export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
53export type ActivitypubHttpFetcherPayload = {
54 uri: string
55 type: FetchType
56 videoId?: number
8dc8a34e
C
57}
58
59export type ActivitypubHttpUnicastPayload = {
60 uri: string
61 signatureActorId?: number
db4b15f2 62 body: object
8dc8a34e
C
63 contextType?: ContextType
64}
65
66export type RefreshPayload = {
67 type: 'video' | 'video-playlist' | 'actor'
68 url: string
69}
70
71export type EmailPayload = SendEmailOptions
72
73export type VideoFileImportPayload = {
74 videoUUID: string
75 filePath: string
76}
77
2158ac90
RK
78export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
79export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
80
8dc8a34e 81export type VideoImportYoutubeDLPayload = {
2158ac90 82 type: VideoImportYoutubeDLPayloadType
8dc8a34e
C
83 videoImportId: number
84
8dc8a34e
C
85 fileExt?: string
86}
87export type VideoImportTorrentPayload = {
2158ac90 88 type: VideoImportTorrentPayloadType
8dc8a34e
C
89 videoImportId: number
90}
91export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
92
93export type VideoRedundancyPayload = {
94 videoId: number
95}
96
97// Video transcoding payloads
98
99interface BaseTranscodingPayload {
100 videoUUID: string
101 isNewVideo?: boolean
102}
103
24516aa2
C
104export interface HLSTranscodingPayload extends BaseTranscodingPayload {
105 type: 'new-resolution-to-hls'
8dc8a34e
C
106 resolution: VideoResolution
107 copyCodecs: boolean
ad5db104 108
cbe2f36d
C
109 hasAudio: boolean
110 isPortraitMode?: boolean
111
ad5db104 112 autoDeleteWebTorrentIfNeeded: boolean
9129b769 113 isMaxQuality: boolean
8dc8a34e
C
114}
115
116export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload {
24516aa2 117 type: 'new-resolution-to-webtorrent'
8dc8a34e 118 resolution: VideoResolution
cbe2f36d
C
119
120 hasAudio: boolean
121
122 isPortraitMode?: boolean
8dc8a34e
C
123}
124
125export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
24516aa2 126 type: 'merge-audio-to-webtorrent'
8dc8a34e
C
127 resolution: VideoResolution
128}
129
130export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
24516aa2 131 type: 'optimize-to-webtorrent'
8dc8a34e
C
132}
133
134export type VideoTranscodingPayload =
135 HLSTranscodingPayload
136 | NewResolutionTranscodingPayload
137 | OptimizeTranscodingPayload
138 | MergeAudioTranscodingPayload
a5cf76af
C
139
140export interface VideoLiveEndingPayload {
141 videoId: number
142}
8795d6f2
C
143
144export interface ActorKeysPayload {
145 actorId: number
146}
0305db28 147
276250f0
RK
148export interface DeleteResumableUploadMetaFilePayload {
149 filepath: string
150}
151
0305db28
JB
152export interface MoveObjectStoragePayload {
153 videoUUID: string
154 isNewVideo: boolean
155}