aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-list/video-miniature.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/video-list/video-miniature.component.ts')
-rw-r--r--client/src/app/videos/video-list/video-miniature.component.ts14
1 files changed, 13 insertions, 1 deletions
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';
2 2
3import { NotificationsService } from 'angular2-notifications'; 3import { NotificationsService } from 'angular2-notifications';
4 4
5import { ConfirmService } from '../../core'; 5import { ConfirmService, ConfigService } from '../../core';
6import { SortField, Video, VideoService } from '../shared'; 6import { SortField, Video, VideoService } from '../shared';
7import { User } from '../../shared'; 7import { User } from '../../shared';
8 8
@@ -24,6 +24,7 @@ export class VideoMiniatureComponent {
24 constructor( 24 constructor(
25 private notificationsService: NotificationsService, 25 private notificationsService: NotificationsService,
26 private confirmService: ConfirmService, 26 private confirmService: ConfirmService,
27 private configService: ConfigService,
27 private videoService: VideoService 28 private videoService: VideoService
28 ) {} 29 ) {}
29 30
@@ -31,6 +32,13 @@ export class VideoMiniatureComponent {
31 return this.hovering && this.video.isRemovableBy(this.user); 32 return this.hovering && this.video.isRemovableBy(this.user);
32 } 33 }
33 34
35 getVideoName() {
36 if (this.isVideoNSFWForThisUser())
37 return 'NSFW';
38
39 return this.video.name;
40 }
41
34 onBlur() { 42 onBlur() {
35 this.hovering = false; 43 this.hovering = false;
36 } 44 }
@@ -52,4 +60,8 @@ export class VideoMiniatureComponent {
52 } 60 }
53 ); 61 );
54 } 62 }
63
64 isVideoNSFWForThisUser() {
65 return this.video.isVideoNSFWForUser(this.user);
66 }
55} 67}