]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/videos/video.model.ts
2373ceb1899c1412b47c8fe5afd8ef99c6680c77
[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
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 VideoChannelAttribute {
21 id: number
22 uuid: string
23 name: string
24 displayName: string
25 url: string
26 host: string
27 avatar: Avatar
28 }
29
30 export interface AccountAttribute {
31 id: number
32 uuid: string
33 name: string
34 displayName: string
35 url: string
36 host: string
37 avatar: Avatar
38 }
39
40 export interface Video {
41 id: number
42 uuid: string
43 createdAt: Date | string
44 updatedAt: Date | string
45 publishedAt: Date | string
46 originallyPublishedAt: 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
87 // Not optional in details (unlike in Video)
88 waitTranscoding: boolean
89 state: VideoConstant<VideoState>
90 }