]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/videos/video.model.ts
WIP plugins: working hook on server side
[github/Chocobozzz/PeerTube.git] / shared / models / videos / video.model.ts
1 import { AccountSummary, VideoChannelSummary, VideoResolution, VideoState } from '../../index'
2 import { Account } from '../actors'
3 import { VideoChannel } from './channel/video-channel.model'
4 import { VideoPrivacy } from './video-privacy.enum'
5 import { VideoScheduleUpdate } from './video-schedule-update.model'
6 import { VideoConstant } from './video-constant.model'
7 import { VideoStreamingPlaylist } from './video-streaming-playlist.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 PlaylistElement {
21 position: number
22 startTimestamp: number
23 stopTimestamp: number
24 }
25
26 export interface Video {
27 id: number
28 uuid: string
29 createdAt: Date | string
30 updatedAt: Date | string
31 publishedAt: Date | string
32 originallyPublishedAt: Date | string
33 category: VideoConstant<number>
34 licence: VideoConstant<number>
35 language: VideoConstant<string>
36 privacy: VideoConstant<VideoPrivacy>
37 description: string
38 duration: number
39 isLocal: boolean
40 name: string
41 thumbnailPath: string
42 previewPath: string
43 embedPath: string
44 views: number
45 likes: number
46 dislikes: number
47 nsfw: boolean
48
49 waitTranscoding?: boolean
50 state?: VideoConstant<VideoState>
51 scheduledUpdate?: VideoScheduleUpdate
52
53 blacklisted?: boolean
54 blacklistedReason?: string
55
56 account: AccountSummary
57 channel: VideoChannelSummary
58
59 userHistory?: {
60 currentTime: number
61 }
62
63 playlistElement?: PlaylistElement
64 }
65
66 export interface VideoDetails extends Video {
67 descriptionPath: string
68 support: string
69 channel: VideoChannel
70 account: Account
71 tags: string[]
72 files: VideoFile[]
73 commentsEnabled: boolean
74 downloadEnabled: boolean
75
76 // Not optional in details (unlike in Video)
77 waitTranscoding: boolean
78 state: VideoConstant<VideoState>
79
80 trackerUrls: string[]
81
82 streamingPlaylists: VideoStreamingPlaylist[]
83 }