PeerTube/shared/models/videos/video.model.ts

84 lines
1.8 KiB
TypeScript
Raw Normal View History

import { VideoResolution, VideoState } from '../../index'
2017-12-14 10:38:41 -06:00
import { Account } from '../actors'
2018-03-12 05:06:15 -05:00
import { Avatar } from '../avatars/avatar.model'
2017-10-24 12:41:09 -05:00
import { VideoChannel } from './video-channel.model'
2017-10-31 05:52:52 -05:00
import { VideoPrivacy } from './video-privacy.enum'
import { VideoScheduleUpdate } from './video-schedule-update.model'
2017-10-24 12:41:09 -05:00
2018-03-19 04:24:12 -05:00
export interface VideoConstant <T> {
2018-04-23 07:39:52 -05:00
id: T
2018-03-19 04:24:12 -05:00
label: string
}
export interface VideoFile {
magnetUri: string
resolution: VideoConstant<VideoResolution>
size: number // Bytes
torrentUrl: string
2018-05-29 11:30:11 -05:00
torrentDownloadUrl: string
fileUrl: string
2018-05-29 11:30:11 -05:00
fileDownloadUrl: string
fps: number
}
2017-06-10 15:15:25 -05:00
export interface Video {
id: number
uuid: string
createdAt: Date | string
updatedAt: Date | string
publishedAt: Date | string
2018-03-19 04:24:12 -05:00
category: VideoConstant<number>
licence: VideoConstant<number>
2018-04-23 07:39:52 -05:00
language: VideoConstant<string>
privacy: VideoConstant<VideoPrivacy>
2017-06-11 04:02:35 -05:00
description: string
duration: number
isLocal: boolean
name: string
thumbnailPath: string
2017-07-12 04:56:02 -05:00
previewPath: string
2017-10-16 03:05:49 -05:00
embedPath: string
2017-06-11 04:02:35 -05:00
views: number
likes: number
dislikes: number
nsfw: boolean
2018-03-12 05:06:15 -05:00
waitTranscoding?: boolean
state?: VideoConstant<VideoState>
scheduledUpdate?: VideoScheduleUpdate
2018-03-12 05:06:15 -05:00
account: {
2018-04-25 07:32:19 -05:00
id: number
uuid: string
2018-03-12 05:06:15 -05:00
name: string
displayName: string
url: string
host: string
avatar: Avatar
}
2018-05-11 08:10:13 -05:00
channel: {
id: number
uuid: string
name: string
displayName: string
url: string
host: string
avatar: Avatar
}
2017-10-24 12:41:09 -05:00
}
export interface VideoDetails extends Video {
2017-10-31 05:52:52 -05:00
descriptionPath: string
support: string
2017-10-24 12:41:09 -05:00
channel: VideoChannel
2017-12-14 03:07:57 -06:00
tags: string[]
files: VideoFile[]
2017-12-06 10:15:59 -06:00
account: Account
2018-01-03 03:12:36 -06:00
commentsEnabled: boolean
// Not optional in details (unlike in Video)
waitTranscoding: boolean
state: VideoConstant<VideoState>
2017-06-10 15:15:25 -05:00
}