]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/videos/video.model.ts
Add ability for uploaders to schedule video update
[github/Chocobozzz/PeerTube.git] / shared / models / videos / video.model.ts
1 import { VideoResolution, VideoState } from '../../index'
2 import { Account } from '../actors'
3 import { Avatar } from '../avatars/avatar.model'
4 import { VideoChannel } from './video-channel.model'
5 import { VideoPrivacy } from './video-privacy.enum'
6
7 export interface VideoConstant <T> {
8 id: T
9 label: string
10 }
11
12 export interface VideoFile {
13 magnetUri: string
14 resolution: VideoConstant<VideoResolution>
15 size: number // Bytes
16 torrentUrl: string
17 torrentDownloadUrl: string
18 fileUrl: string
19 fileDownloadUrl: string
20 }
21
22 export interface Video {
23 id: number
24 uuid: string
25 createdAt: Date | string
26 updatedAt: Date | string
27 publishedAt: Date | string
28 category: VideoConstant<number>
29 licence: VideoConstant<number>
30 language: VideoConstant<string>
31 privacy: VideoConstant<VideoPrivacy>
32 description: string
33 duration: number
34 isLocal: boolean
35 name: string
36 thumbnailPath: string
37 previewPath: string
38 embedPath: string
39 views: number
40 likes: number
41 dislikes: number
42 nsfw: boolean
43
44 waitTranscoding?: boolean
45 state?: VideoConstant<VideoState>
46 scheduledUpdate?: {
47 updateAt: Date | string
48 privacy?: VideoPrivacy
49 }
50
51 account: {
52 id: number
53 uuid: string
54 name: string
55 displayName: string
56 url: string
57 host: string
58 avatar: Avatar
59 }
60
61 channel: {
62 id: number
63 uuid: string
64 name: string
65 displayName: string
66 url: string
67 host: string
68 avatar: Avatar
69 }
70 }
71
72 export interface VideoDetails extends Video {
73 descriptionPath: string
74 support: string
75 channel: VideoChannel
76 tags: string[]
77 files: VideoFile[]
78 account: Account
79 commentsEnabled: boolean
80
81 // Not optional in details (unlike in Video)
82 waitTranscoding: boolean
83 state: VideoConstant<VideoState>
84 }