X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-live.ts;h=cb4a9b8968e87954da0cadd6e91e8aef241d1ee5;hb=9a320a06b663a2e02c3156a07135f75f9e987b11;hp=8608bc84ca9f654ff2b262904ef4072ff177b15d;hpb=a5cf76afa378aae81af2a9b0ce548e5d2582f832;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-live.ts b/server/models/video/video-live.ts index 8608bc84c..cb4a9b896 100644 --- a/server/models/video/video-live.ts +++ b/server/models/video/video-live.ts @@ -28,12 +28,20 @@ import { VideoBlacklistModel } from './video-blacklist' } ] }) -export class VideoLiveModel extends Model { +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 { 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 } } }