]>
Commit | Line | Data |
---|---|---|
e307e4fc | 1 | import { ContextType } from '../activitypub/context' |
0fecf427 C |
2 | import { VideoResolution } from '../videos/video-resolution.enum' |
3 | import { SendEmailOptions } from './emailer.model' | |
8dc8a34e | 4 | |
94831479 | 5 | export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' |
94a5ff8a | 6 | |
a1587156 C |
7 | export type JobType = |
8 | | 'activitypub-http-unicast' | |
9 | | 'activitypub-http-broadcast' | |
10 | | 'activitypub-http-fetcher' | |
11 | | 'activitypub-follow' | |
12 | | 'video-file-import' | |
13 | | 'video-transcoding' | |
14 | | 'email' | |
15 | | 'video-import' | |
16 | | 'videos-views' | |
17 | | 'activitypub-refresher' | |
18 | | 'video-redundancy' | |
a5cf76af | 19 | | 'video-live-ending' |
5cd80545 C |
20 | |
21 | export interface Job { | |
22 | id: number | |
23 | state: JobState | |
94a5ff8a | 24 | type: JobType |
a1587156 C |
25 | data: any |
26 | error: any | |
1061c73f C |
27 | createdAt: Date | string |
28 | finishedOn: Date | string | |
29 | processedOn: Date | string | |
5cd80545 | 30 | } |
8dc8a34e C |
31 | |
32 | export type ActivitypubHttpBroadcastPayload = { | |
33 | uris: string[] | |
34 | signatureActorId?: number | |
35 | body: any | |
36 | contextType?: ContextType | |
37 | } | |
38 | ||
39 | export type ActivitypubFollowPayload = { | |
40 | followerActorId: number | |
41 | name: string | |
42 | host: string | |
43 | isAutoFollow?: boolean | |
44 | assertIsChannel?: boolean | |
45 | } | |
46 | ||
47 | export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists' | |
48 | export type ActivitypubHttpFetcherPayload = { | |
49 | uri: string | |
50 | type: FetchType | |
51 | videoId?: number | |
52 | accountId?: number | |
53 | } | |
54 | ||
55 | export type ActivitypubHttpUnicastPayload = { | |
56 | uri: string | |
57 | signatureActorId?: number | |
58 | body: any | |
59 | contextType?: ContextType | |
60 | } | |
61 | ||
62 | export type RefreshPayload = { | |
63 | type: 'video' | 'video-playlist' | 'actor' | |
64 | url: string | |
65 | } | |
66 | ||
67 | export type EmailPayload = SendEmailOptions | |
68 | ||
69 | export type VideoFileImportPayload = { | |
70 | videoUUID: string | |
71 | filePath: string | |
72 | } | |
73 | ||
2158ac90 RK |
74 | export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file' |
75 | export type VideoImportYoutubeDLPayloadType = 'youtube-dl' | |
76 | ||
8dc8a34e | 77 | export type VideoImportYoutubeDLPayload = { |
2158ac90 | 78 | type: VideoImportYoutubeDLPayloadType |
8dc8a34e C |
79 | videoImportId: number |
80 | ||
81 | generateThumbnail: boolean | |
82 | generatePreview: boolean | |
83 | ||
84 | fileExt?: string | |
85 | } | |
86 | export type VideoImportTorrentPayload = { | |
2158ac90 | 87 | type: VideoImportTorrentPayloadType |
8dc8a34e C |
88 | videoImportId: number |
89 | } | |
90 | export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload | |
91 | ||
92 | export type VideoRedundancyPayload = { | |
93 | videoId: number | |
94 | } | |
95 | ||
96 | // Video transcoding payloads | |
97 | ||
98 | interface BaseTranscodingPayload { | |
99 | videoUUID: string | |
100 | isNewVideo?: boolean | |
101 | } | |
102 | ||
103 | interface HLSTranscodingPayload extends BaseTranscodingPayload { | |
104 | type: 'hls' | |
105 | isPortraitMode?: boolean | |
106 | resolution: VideoResolution | |
107 | copyCodecs: boolean | |
108 | } | |
109 | ||
110 | export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload { | |
111 | type: 'new-resolution' | |
112 | isPortraitMode?: boolean | |
113 | resolution: VideoResolution | |
114 | } | |
115 | ||
116 | export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { | |
117 | type: 'merge-audio' | |
118 | resolution: VideoResolution | |
119 | } | |
120 | ||
121 | export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { | |
122 | type: 'optimize' | |
123 | } | |
124 | ||
125 | export type VideoTranscodingPayload = | |
126 | HLSTranscodingPayload | |
127 | | NewResolutionTranscodingPayload | |
128 | | OptimizeTranscodingPayload | |
129 | | MergeAudioTranscodingPayload | |
a5cf76af C |
130 | |
131 | export interface VideoLiveEndingPayload { | |
132 | videoId: number | |
133 | } |