]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/videos/video.model.ts
8d223cded5b85b10c85383d390dc798b330074fb
[github/Chocobozzz/PeerTube.git] / shared / models / videos / video.model.ts
1 import { Account, AccountSummary } from '../actors'
2 import { VideoChannel, VideoChannelSummary } from './channel/video-channel.model'
3 import { VideoConstant } from './video-constant.model'
4 import { VideoFile } from './video-file.model'
5 import { VideoPrivacy } from './video-privacy.enum'
6 import { VideoScheduleUpdate } from './video-schedule-update.model'
7 import { VideoState } from './video-state.enum'
8 import { VideoStreamingPlaylist } from './video-streaming-playlist.model'
9
10 export interface Video {
11 id: number
12 uuid: string
13 shortUUID: string
14
15 createdAt: Date | string
16 updatedAt: Date | string
17 publishedAt: Date | string
18 originallyPublishedAt: Date | string
19 category: VideoConstant<number>
20 licence: VideoConstant<number>
21 language: VideoConstant<string>
22 privacy: VideoConstant<VideoPrivacy>
23 description: string
24 duration: number
25 isLocal: boolean
26 name: string
27
28 isLive: boolean
29
30 thumbnailPath: string
31 thumbnailUrl?: string
32
33 previewPath: string
34 previewUrl?: string
35
36 embedPath: string
37 embedUrl?: string
38
39 url: string
40
41 views: number
42 // If live
43 viewers?: number
44
45 likes: number
46 dislikes: number
47 nsfw: boolean
48
49 account: AccountSummary
50 channel: VideoChannelSummary
51
52 userHistory?: {
53 currentTime: number
54 }
55
56 pluginData?: any
57
58 // Additional attributes dependending on the query
59 waitTranscoding?: boolean
60 state?: VideoConstant<VideoState>
61 scheduledUpdate?: VideoScheduleUpdate
62
63 blacklisted?: boolean
64 blacklistedReason?: string
65
66 blockedOwner?: boolean
67 blockedServer?: boolean
68
69 files?: VideoFile[]
70 streamingPlaylists?: VideoStreamingPlaylist[]
71 }
72
73 export interface VideoDetails extends Video {
74 descriptionPath: string
75 support: string
76 channel: VideoChannel
77 account: Account
78 tags: string[]
79 commentsEnabled: boolean
80 downloadEnabled: boolean
81
82 // Not optional in details (unlike in parent Video)
83 waitTranscoding: boolean
84 state: VideoConstant<VideoState>
85
86 trackerUrls: string[]
87
88 files: VideoFile[]
89 streamingPlaylists: VideoStreamingPlaylist[]
90 }