aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-09-17 09:20:52 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commitc6c0fa6cd8fe8f752463d8982c3dbcd448739c4e (patch)
tree79304b0152b0a38d33b26e65d4acdad0da4032a7 /server/lib/video.ts
parent110d463fece85e87a26aca48a6048ae0017a27b3 (diff)
downloadPeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.gz
PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.zst
PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.zip
Live streaming implementation first step
Diffstat (limited to 'server/lib/video.ts')
-rw-r--r--server/lib/video.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/server/lib/video.ts b/server/lib/video.ts
new file mode 100644
index 000000000..a28f31529
--- /dev/null
+++ b/server/lib/video.ts
@@ -0,0 +1,31 @@
1
2import { VideoModel } from '@server/models/video/video'
3import { FilteredModelAttributes } from '@server/types'
4import { VideoCreate, VideoPrivacy, VideoState } from '@shared/models'
5
6function buildLocalVideoFromCreate (videoInfo: VideoCreate, channelId: number): FilteredModelAttributes<VideoModel> {
7 return {
8 name: videoInfo.name,
9 remote: false,
10 category: videoInfo.category,
11 licence: videoInfo.licence,
12 language: videoInfo.language,
13 commentsEnabled: videoInfo.commentsEnabled !== false, // If the value is not "false", the default is "true"
14 downloadEnabled: videoInfo.downloadEnabled !== false,
15 waitTranscoding: videoInfo.waitTranscoding || false,
16 state: VideoState.WAITING_FOR_LIVE,
17 nsfw: videoInfo.nsfw || false,
18 description: videoInfo.description,
19 support: videoInfo.support,
20 privacy: videoInfo.privacy || VideoPrivacy.PRIVATE,
21 duration: 0,
22 channelId: channelId,
23 originallyPublishedAt: videoInfo.originallyPublishedAt
24 }
25}
26
27// ---------------------------------------------------------------------------
28
29export {
30 buildLocalVideoFromCreate
31}