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