]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-live.ts
add response content for createVideoChannel endpoint in openapi spec
[github/Chocobozzz/PeerTube.git] / server / models / video / video-live.ts
index 8608bc84ca9f654ff2b262904ef4072ff177b15d..cb4a9b8968e87954da0cadd6e91e8aef241d1ee5 100644 (file)
@@ -28,12 +28,20 @@ import { VideoBlacklistModel } from './video-blacklist'
     }
   ]
 })
-export class VideoLiveModel extends Model<VideoLiveModel> {
+export class VideoLiveModel extends Model {
 
-  @AllowNull(false)
+  @AllowNull(true)
   @Column(DataType.STRING)
   streamKey: string
 
+  @AllowNull(false)
+  @Column
+  saveReplay: boolean
+
+  @AllowNull(false)
+  @Column
+  permanentLive: boolean
+
   @CreatedAt
   createdAt: Date
 
@@ -89,8 +97,14 @@ export class VideoLiveModel extends Model<VideoLiveModel> {
 
   toFormattedJSON (): LiveVideo {
     return {
-      rtmpUrl: WEBSERVER.RTMP_URL,
-      streamKey: this.streamKey
+      // If we don't have a stream key, it means this is a remote live so we don't specify the rtmp URL
+      rtmpUrl: this.streamKey
+        ? WEBSERVER.RTMP_URL
+        : null,
+
+      streamKey: this.streamKey,
+      permanentLive: this.permanentLive,
+      saveReplay: this.saveReplay
     }
   }
 }