]>
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 | |
402145b8 | 5 | export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused' |
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 | 25 | data: any |
77d7e851 | 26 | priority: number |
3b01f4c0 | 27 | progress: number |
a1587156 | 28 | error: any |
1061c73f C |
29 | createdAt: Date | string |
30 | finishedOn: Date | string | |
31 | processedOn: Date | string | |
5cd80545 | 32 | } |
8dc8a34e C |
33 | |
34 | export type ActivitypubHttpBroadcastPayload = { | |
35 | uris: string[] | |
36 | signatureActorId?: number | |
37 | body: any | |
38 | contextType?: ContextType | |
39 | } | |
40 | ||
41 | export type ActivitypubFollowPayload = { | |
42 | followerActorId: number | |
43 | name: string | |
44 | host: string | |
45 | isAutoFollow?: boolean | |
46 | assertIsChannel?: boolean | |
47 | } | |
48 | ||
49 | export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists' | |
50 | export type ActivitypubHttpFetcherPayload = { | |
51 | uri: string | |
52 | type: FetchType | |
53 | videoId?: number | |
54 | accountId?: number | |
55 | } | |
56 | ||
57 | export type ActivitypubHttpUnicastPayload = { | |
58 | uri: string | |
59 | signatureActorId?: number | |
60 | body: any | |
61 | contextType?: ContextType | |
62 | } | |
63 | ||
64 | export type RefreshPayload = { | |
65 | type: 'video' | 'video-playlist' | 'actor' | |
66 | url: string | |
67 | } | |
68 | ||
69 | export type EmailPayload = SendEmailOptions | |
70 | ||
71 | export type VideoFileImportPayload = { | |
72 | videoUUID: string | |
73 | filePath: string | |
74 | } | |
75 | ||
2158ac90 RK |
76 | export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file' |
77 | export type VideoImportYoutubeDLPayloadType = 'youtube-dl' | |
78 | ||
8dc8a34e | 79 | export type VideoImportYoutubeDLPayload = { |
2158ac90 | 80 | type: VideoImportYoutubeDLPayloadType |
8dc8a34e C |
81 | videoImportId: number |
82 | ||
83 | generateThumbnail: boolean | |
84 | generatePreview: boolean | |
8dc8a34e C |
85 | fileExt?: string |
86 | } | |
87 | export type VideoImportTorrentPayload = { | |
2158ac90 | 88 | type: VideoImportTorrentPayloadType |
8dc8a34e C |
89 | videoImportId: number |
90 | } | |
91 | export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload | |
92 | ||
93 | export type VideoRedundancyPayload = { | |
94 | videoId: number | |
95 | } | |
96 | ||
97 | // Video transcoding payloads | |
98 | ||
99 | interface BaseTranscodingPayload { | |
100 | videoUUID: string | |
101 | isNewVideo?: boolean | |
102 | } | |
103 | ||
24516aa2 C |
104 | export interface HLSTranscodingPayload extends BaseTranscodingPayload { |
105 | type: 'new-resolution-to-hls' | |
8dc8a34e C |
106 | isPortraitMode?: boolean |
107 | resolution: VideoResolution | |
108 | copyCodecs: boolean | |
109 | } | |
110 | ||
111 | export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload { | |
24516aa2 | 112 | type: 'new-resolution-to-webtorrent' |
8dc8a34e C |
113 | isPortraitMode?: boolean |
114 | resolution: VideoResolution | |
115 | } | |
116 | ||
117 | export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { | |
24516aa2 | 118 | type: 'merge-audio-to-webtorrent' |
8dc8a34e C |
119 | resolution: VideoResolution |
120 | } | |
121 | ||
122 | export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { | |
24516aa2 | 123 | type: 'optimize-to-webtorrent' |
8dc8a34e C |
124 | } |
125 | ||
126 | export type VideoTranscodingPayload = | |
127 | HLSTranscodingPayload | |
128 | | NewResolutionTranscodingPayload | |
129 | | OptimizeTranscodingPayload | |
130 | | MergeAudioTranscodingPayload | |
a5cf76af C |
131 | |
132 | export interface VideoLiveEndingPayload { | |
133 | videoId: number | |
134 | } |