]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/videos/video.model.ts
857ca1fd97982560ae7a2bafbadab55e819c9b41
[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
47 account: {
48 id: number
49 uuid: string
50 name: string
51 displayName: string
52 url: string
53 host: string
54 avatar: Avatar
55 }
56
57 channel: {
58 id: number
59 uuid: string
60 name: string
61 displayName: string
62 url: string
63 host: string
64 avatar: Avatar
65 }
66 }
67
68 export interface VideoDetails extends Video {
69 descriptionPath: string
70 support: string
71 channel: VideoChannel
72 tags: string[]
73 files: VideoFile[]
74 account: Account
75 commentsEnabled: boolean
76
77 // Not optional in details (unlike in Video)
78 waitTranscoding: boolean
79 state: VideoConstant<VideoState>
80 }