From 92fb909c9b4a92a00b0d0da7629e6fb003de281b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Apr 2017 21:37:03 +0200 Subject: Client: Handle NSFW video --- .../src/app/videos/video-list/video-miniature.component.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'client/src/app/videos/video-list/video-miniature.component.ts') diff --git a/client/src/app/videos/video-list/video-miniature.component.ts b/client/src/app/videos/video-list/video-miniature.component.ts index ba4715597..888026dde 100644 --- a/client/src/app/videos/video-list/video-miniature.component.ts +++ b/client/src/app/videos/video-list/video-miniature.component.ts @@ -2,7 +2,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; import { NotificationsService } from 'angular2-notifications'; -import { ConfirmService } from '../../core'; +import { ConfirmService, ConfigService } from '../../core'; import { SortField, Video, VideoService } from '../shared'; import { User } from '../../shared'; @@ -24,6 +24,7 @@ export class VideoMiniatureComponent { constructor( private notificationsService: NotificationsService, private confirmService: ConfirmService, + private configService: ConfigService, private videoService: VideoService ) {} @@ -31,6 +32,13 @@ export class VideoMiniatureComponent { return this.hovering && this.video.isRemovableBy(this.user); } + getVideoName() { + if (this.isVideoNSFWForThisUser()) + return 'NSFW'; + + return this.video.name; + } + onBlur() { this.hovering = false; } @@ -52,4 +60,8 @@ export class VideoMiniatureComponent { } ); } + + isVideoNSFWForThisUser() { + return this.video.isVideoNSFWForUser(this.user); + } } -- cgit v1.2.3