]>
Commit | Line | Data |
---|---|---|
e307e4fc | 1 | import { ContextType } from '../activitypub/context' |
1808a1f8 | 2 | import { VideoState } from '../videos' |
c729caf6 | 3 | import { VideoEditorTaskCut } from '../videos/editor' |
ad5db104 | 4 | import { VideoResolution } from '../videos/file/video-resolution.enum' |
0fecf427 | 5 | import { SendEmailOptions } from './emailer.model' |
8dc8a34e | 6 | |
402145b8 | 7 | export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused' |
94a5ff8a | 8 | |
a1587156 C |
9 | export type JobType = |
10 | | 'activitypub-http-unicast' | |
11 | | 'activitypub-http-broadcast' | |
12 | | 'activitypub-http-fetcher' | |
74d249bc | 13 | | 'activitypub-cleaner' |
a1587156 C |
14 | | 'activitypub-follow' |
15 | | 'video-file-import' | |
16 | | 'video-transcoding' | |
17 | | 'email' | |
18 | | 'video-import' | |
51353d9a | 19 | | 'videos-views-stats' |
a1587156 C |
20 | | 'activitypub-refresher' |
21 | | 'video-redundancy' | |
a5cf76af | 22 | | 'video-live-ending' |
8795d6f2 | 23 | | 'actor-keys' |
f012319a | 24 | | 'manage-video-torrent' |
0305db28 | 25 | | 'move-to-object-storage' |
c729caf6 | 26 | | 'video-edition' |
5cd80545 C |
27 | |
28 | export interface Job { | |
29 | id: number | |
30 | state: JobState | |
94a5ff8a | 31 | type: JobType |
a1587156 | 32 | data: any |
77d7e851 | 33 | priority: number |
3b01f4c0 | 34 | progress: number |
a1587156 | 35 | error: any |
1061c73f C |
36 | createdAt: Date | string |
37 | finishedOn: Date | string | |
38 | processedOn: Date | string | |
5cd80545 | 39 | } |
8dc8a34e C |
40 | |
41 | export type ActivitypubHttpBroadcastPayload = { | |
42 | uris: string[] | |
43 | signatureActorId?: number | |
44 | body: any | |
45 | contextType?: ContextType | |
46 | } | |
47 | ||
48 | export type ActivitypubFollowPayload = { | |
49 | followerActorId: number | |
50 | name: string | |
51 | host: string | |
52 | isAutoFollow?: boolean | |
53 | assertIsChannel?: boolean | |
54 | } | |
55 | ||
57e4e1c1 | 56 | export type FetchType = 'activity' | 'video-shares' | 'video-comments' | 'account-playlists' |
8dc8a34e C |
57 | export type ActivitypubHttpFetcherPayload = { |
58 | uri: string | |
59 | type: FetchType | |
60 | videoId?: number | |
8dc8a34e C |
61 | } |
62 | ||
63 | export type ActivitypubHttpUnicastPayload = { | |
64 | uri: string | |
65 | signatureActorId?: number | |
db4b15f2 | 66 | body: object |
8dc8a34e C |
67 | contextType?: ContextType |
68 | } | |
69 | ||
70 | export type RefreshPayload = { | |
71 | type: 'video' | 'video-playlist' | 'actor' | |
72 | url: string | |
73 | } | |
74 | ||
75 | export type EmailPayload = SendEmailOptions | |
76 | ||
77 | export type VideoFileImportPayload = { | |
78 | videoUUID: string | |
79 | filePath: string | |
80 | } | |
81 | ||
2158ac90 RK |
82 | export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file' |
83 | export type VideoImportYoutubeDLPayloadType = 'youtube-dl' | |
84 | ||
8dc8a34e | 85 | export type VideoImportYoutubeDLPayload = { |
2158ac90 | 86 | type: VideoImportYoutubeDLPayloadType |
8dc8a34e C |
87 | videoImportId: number |
88 | ||
8dc8a34e C |
89 | fileExt?: string |
90 | } | |
91 | export type VideoImportTorrentPayload = { | |
2158ac90 | 92 | type: VideoImportTorrentPayloadType |
8dc8a34e C |
93 | videoImportId: number |
94 | } | |
95 | export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload | |
96 | ||
97 | export type VideoRedundancyPayload = { | |
98 | videoId: number | |
99 | } | |
100 | ||
f012319a C |
101 | export type ManageVideoTorrentPayload = |
102 | { | |
103 | action: 'create' | |
104 | videoId: number | |
105 | videoFileId: number | |
106 | } | { | |
107 | action: 'update-metadata' | |
108 | ||
109 | videoId?: number | |
110 | streamingPlaylistId?: number | |
111 | ||
112 | videoFileId: number | |
113 | } | |
114 | ||
8dc8a34e C |
115 | // Video transcoding payloads |
116 | ||
117 | interface BaseTranscodingPayload { | |
118 | videoUUID: string | |
119 | isNewVideo?: boolean | |
1808a1f8 C |
120 | |
121 | // Custom notification when the task is finished | |
122 | notification?: 'default' | 'video-edition' | |
8dc8a34e C |
123 | } |
124 | ||
24516aa2 C |
125 | export interface HLSTranscodingPayload extends BaseTranscodingPayload { |
126 | type: 'new-resolution-to-hls' | |
8dc8a34e C |
127 | resolution: VideoResolution |
128 | copyCodecs: boolean | |
ad5db104 | 129 | |
cbe2f36d C |
130 | hasAudio: boolean |
131 | isPortraitMode?: boolean | |
132 | ||
ad5db104 | 133 | autoDeleteWebTorrentIfNeeded: boolean |
9129b769 | 134 | isMaxQuality: boolean |
8dc8a34e C |
135 | } |
136 | ||
0f11ec8d | 137 | export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload { |
24516aa2 | 138 | type: 'new-resolution-to-webtorrent' |
8dc8a34e | 139 | resolution: VideoResolution |
cbe2f36d C |
140 | |
141 | hasAudio: boolean | |
0f11ec8d | 142 | createHLSIfNeeded: boolean |
cbe2f36d C |
143 | |
144 | isPortraitMode?: boolean | |
8dc8a34e C |
145 | } |
146 | ||
147 | export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { | |
24516aa2 | 148 | type: 'merge-audio-to-webtorrent' |
8dc8a34e | 149 | resolution: VideoResolution |
0f11ec8d | 150 | createHLSIfNeeded: true |
8dc8a34e C |
151 | } |
152 | ||
153 | export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { | |
24516aa2 | 154 | type: 'optimize-to-webtorrent' |
8dc8a34e C |
155 | } |
156 | ||
157 | export type VideoTranscodingPayload = | |
158 | HLSTranscodingPayload | |
0f11ec8d | 159 | | NewWebTorrentResolutionTranscodingPayload |
8dc8a34e C |
160 | | OptimizeTranscodingPayload |
161 | | MergeAudioTranscodingPayload | |
a5cf76af C |
162 | |
163 | export interface VideoLiveEndingPayload { | |
164 | videoId: number | |
165 | } | |
8795d6f2 C |
166 | |
167 | export interface ActorKeysPayload { | |
168 | actorId: number | |
169 | } | |
0305db28 | 170 | |
276250f0 RK |
171 | export interface DeleteResumableUploadMetaFilePayload { |
172 | filepath: string | |
173 | } | |
174 | ||
0305db28 JB |
175 | export interface MoveObjectStoragePayload { |
176 | videoUUID: string | |
177 | isNewVideo: boolean | |
1808a1f8 | 178 | previousVideoState: VideoState |
0305db28 | 179 | } |
c729caf6 C |
180 | |
181 | export type VideoEditorTaskCutPayload = VideoEditorTaskCut | |
182 | ||
183 | export type VideoEditorTaskIntroPayload = { | |
184 | name: 'add-intro' | |
185 | ||
186 | options: { | |
187 | file: string | |
188 | } | |
189 | } | |
190 | ||
191 | export type VideoEditorTaskOutroPayload = { | |
192 | name: 'add-outro' | |
193 | ||
194 | options: { | |
195 | file: string | |
196 | } | |
197 | } | |
198 | ||
199 | export type VideoEditorTaskWatermarkPayload = { | |
200 | name: 'add-watermark' | |
201 | ||
202 | options: { | |
203 | file: string | |
204 | } | |
205 | } | |
206 | ||
207 | export type VideoEditionTaskPayload = | |
208 | VideoEditorTaskCutPayload | | |
209 | VideoEditorTaskIntroPayload | | |
210 | VideoEditorTaskOutroPayload | | |
211 | VideoEditorTaskWatermarkPayload | |
212 | ||
213 | export interface VideoEditionPayload { | |
214 | videoUUID: string | |
215 | tasks: VideoEditionTaskPayload[] | |
216 | } |