diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index 8243b9f1c..cf6b71b60 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts @@ -1,14 +1,10 @@ -import { Account } from '../../../../../shared/models/actors' -import { Video } from '../../shared/video/video.model' -import { AuthUser } from '../../core' import { - VideoDetails as VideoDetailsServerModel, - VideoFile, - VideoChannel, - VideoResolution, - UserRight, - VideoPrivacy + UserRight, VideoChannel, VideoDetails as VideoDetailsServerModel, VideoFile, VideoPrivacy, + VideoResolution } from '../../../../../shared' +import { Account } from '../../../../../shared/models/actors' +import { AuthUser } from '../../core' +import { Video } from '../../shared/video/video.model' export class VideoDetails extends Video implements VideoDetailsServerModel { accountName: string @@ -48,6 +44,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { account: Account likesPercent: number dislikesPercent: number + commentsEnabled: boolean constructor (hash: VideoDetailsServerModel) { super(hash) @@ -59,6 +56,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { this.channel = hash.channel this.account = hash.account this.tags = hash.tags + this.commentsEnabled = hash.commentsEnabled this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100 diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts index 47c63d976..b1c772217 100644 --- a/client/src/app/shared/video/video-edit.model.ts +++ b/client/src/app/shared/video/video-edit.model.ts @@ -9,6 +9,7 @@ export class VideoEdit { name: string tags: string[] nsfw: boolean + commentsEnabled: boolean channel: number privacy: VideoPrivacy uuid?: string @@ -25,6 +26,7 @@ export class VideoEdit { this.name = videoDetails.name this.tags = videoDetails.tags this.nsfw = videoDetails.nsfw + this.commentsEnabled = videoDetails.commentsEnabled this.channel = videoDetails.channel.id this.privacy = videoDetails.privacy } @@ -45,6 +47,7 @@ export class VideoEdit { name: this.name, tags: this.tags, nsfw: this.nsfw, + commentsEnabled: this.commentsEnabled, channelId: this.channel, privacy: this.privacy } diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index fc7505a51..073acb2b6 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts @@ -55,7 +55,8 @@ export class VideoService { description, privacy: video.privacy, tags: video.tags, - nsfw: video.nsfw + nsfw: video.nsfw, + commentsEnabled: video.commentsEnabled } return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, body) diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html index 9acbafcb6..80377933e 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html @@ -99,5 +99,11 @@ +