Use ISO 639 for languages
[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: T
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   publishedAt: Date | string
26   category: VideoConstant<number>
27   licence: VideoConstant<number>
28   language: VideoConstant<string>
29   privacy: VideoConstant<VideoPrivacy>
30   description: string
31   duration: number
32   isLocal: boolean
33   name: string
34   thumbnailPath: string
35   previewPath: string
36   embedPath: string
37   views: number
38   likes: number
39   dislikes: number
40   nsfw: boolean
41
42   account: {
43     name: string
44     displayName: string
45     url: string
46     host: string
47     avatar: Avatar
48   }
49 }
50
51 export interface VideoDetails extends Video {
52   descriptionPath: string
53   support: string
54   channel: VideoChannel
55   tags: string[]
56   files: VideoFile[]
57   account: Account
58   commentsEnabled: boolean
59 }