]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/videos/video.model.ts
Merge branch 'develop' into pr/1285
[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 originallyPublishedAt: Date | string
48 category: VideoConstant<number>
49 licence: VideoConstant<number>
50 language: VideoConstant<string>
51 privacy: VideoConstant<VideoPrivacy>
52 description: string
53 duration: number
54 isLocal: boolean
55 name: string
56 thumbnailPath: string
57 previewPath: string
58 embedPath: string
59 views: number
60 likes: number
61 dislikes: number
62 nsfw: boolean
63
64 waitTranscoding?: boolean
65 state?: VideoConstant<VideoState>
66 scheduledUpdate?: VideoScheduleUpdate
67
68 blacklisted?: boolean
69 blacklistedReason?: string
70
71 account: AccountAttribute
72 channel: VideoChannelAttribute
73
74 userHistory?: {
75 currentTime: number
76 }
77 }
78
79 export interface VideoDetails extends Video {
80 descriptionPath: string
81 support: string
82 channel: VideoChannel
83 tags: string[]
84 files: VideoFile[]
85 account: Account
86 commentsEnabled: boolean
87 downloadEnabled: boolean
88
89 // Not optional in details (unlike in Video)
90 waitTranscoding: boolean
91 state: VideoConstant<VideoState>
92
93 trackerUrls: string[]
94
95 streamingPlaylists: VideoStreamingPlaylist[]
96 }