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