diff options
Diffstat (limited to 'packages/models/src/videos/video.model.ts')
-rw-r--r-- | packages/models/src/videos/video.model.ts | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/packages/models/src/videos/video.model.ts b/packages/models/src/videos/video.model.ts new file mode 100644 index 000000000..a750e220d --- /dev/null +++ b/packages/models/src/videos/video.model.ts | |||
@@ -0,0 +1,99 @@ | |||
1 | import { Account, AccountSummary } from '../actors/index.js' | ||
2 | import { VideoChannel, VideoChannelSummary } from './channel/video-channel.model.js' | ||
3 | import { VideoFile } from './file/index.js' | ||
4 | import { VideoConstant } from './video-constant.model.js' | ||
5 | import { VideoPrivacyType } from './video-privacy.enum.js' | ||
6 | import { VideoScheduleUpdate } from './video-schedule-update.model.js' | ||
7 | import { VideoStateType } from './video-state.enum.js' | ||
8 | import { VideoStreamingPlaylist } from './video-streaming-playlist.model.js' | ||
9 | |||
10 | export interface Video extends Partial<VideoAdditionalAttributes> { | ||
11 | id: number | ||
12 | uuid: string | ||
13 | shortUUID: string | ||
14 | |||
15 | createdAt: Date | string | ||
16 | updatedAt: Date | string | ||
17 | publishedAt: Date | string | ||
18 | originallyPublishedAt: Date | string | ||
19 | category: VideoConstant<number> | ||
20 | licence: VideoConstant<number> | ||
21 | language: VideoConstant<string> | ||
22 | privacy: VideoConstant<VideoPrivacyType> | ||
23 | |||
24 | // Deprecated in 5.0 in favour of truncatedDescription | ||
25 | description: string | ||
26 | truncatedDescription: string | ||
27 | |||
28 | duration: number | ||
29 | isLocal: boolean | ||
30 | name: string | ||
31 | |||
32 | isLive: boolean | ||
33 | |||
34 | thumbnailPath: string | ||
35 | thumbnailUrl?: string | ||
36 | |||
37 | previewPath: string | ||
38 | previewUrl?: string | ||
39 | |||
40 | embedPath: string | ||
41 | embedUrl?: string | ||
42 | |||
43 | url: string | ||
44 | |||
45 | views: number | ||
46 | viewers: number | ||
47 | |||
48 | likes: number | ||
49 | dislikes: number | ||
50 | nsfw: boolean | ||
51 | |||
52 | account: AccountSummary | ||
53 | channel: VideoChannelSummary | ||
54 | |||
55 | userHistory?: { | ||
56 | currentTime: number | ||
57 | } | ||
58 | |||
59 | pluginData?: any | ||
60 | } | ||
61 | |||
62 | // Not included by default, needs query params | ||
63 | export interface VideoAdditionalAttributes { | ||
64 | waitTranscoding: boolean | ||
65 | state: VideoConstant<VideoStateType> | ||
66 | scheduledUpdate: VideoScheduleUpdate | ||
67 | |||
68 | blacklisted: boolean | ||
69 | blacklistedReason: string | ||
70 | |||
71 | blockedOwner: boolean | ||
72 | blockedServer: boolean | ||
73 | |||
74 | files: VideoFile[] | ||
75 | streamingPlaylists: VideoStreamingPlaylist[] | ||
76 | } | ||
77 | |||
78 | export interface VideoDetails extends Video { | ||
79 | // Deprecated in 5.0 | ||
80 | descriptionPath: string | ||
81 | |||
82 | support: string | ||
83 | channel: VideoChannel | ||
84 | account: Account | ||
85 | tags: string[] | ||
86 | commentsEnabled: boolean | ||
87 | downloadEnabled: boolean | ||
88 | |||
89 | // Not optional in details (unlike in parent Video) | ||
90 | waitTranscoding: boolean | ||
91 | state: VideoConstant<VideoStateType> | ||
92 | |||
93 | trackerUrls: string[] | ||
94 | |||
95 | files: VideoFile[] | ||
96 | streamingPlaylists: VideoStreamingPlaylist[] | ||
97 | |||
98 | inputFileUpdatedAt: string | Date | ||
99 | } | ||