BEARKING CHANGE: Update videos API response
[oweals/peertube.git] / shared / models / videos / video.model.ts
1 import { VideoResolution } 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
7 export interface VideoConstant <T> {
8   id: number
9   label: string
10 }
11
12 export interface VideoFile {
13   magnetUri: string
14   resolution: VideoConstant<VideoResolution>
15   size: number // Bytes
16   torrentUrl: string
17   fileUrl: string
18 }
19
20 export interface Video {
21   id: number
22   uuid: string
23   createdAt: Date | string
24   updatedAt: Date | string
25   category: VideoConstant<number>
26   licence: VideoConstant<number>
27   language: VideoConstant<number>
28   description: string
29   duration: number
30   isLocal: boolean
31   name: string
32   thumbnailPath: string
33   previewPath: string
34   embedPath: string
35   views: number
36   likes: number
37   dislikes: number
38   nsfw: boolean
39
40   account: {
41     name: string
42     displayName: string
43     url: string
44     host: string
45     avatar: Avatar
46   }
47 }
48
49 export interface VideoDetails extends Video {
50   privacy: VideoConstant<VideoPrivacy>
51   descriptionPath: string
52   support: string
53   channel: VideoChannel
54   tags: string[]
55   files: VideoFile[]
56   account: Account
57   commentsEnabled: boolean
58 }