]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/video-list/video-miniature.component.ts
Server: upgrade packages
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-list / video-miniature.component.ts
1 import { Component, Input, Output, EventEmitter } from '@angular/core'
2
3 import { NotificationsService } from 'angular2-notifications'
4
5 import { ConfirmService, ConfigService } from '../../core'
6 import { SortField, Video, VideoService } from '../shared'
7 import { User } from '../../shared'
8
9 @Component({
10 selector: 'my-video-miniature',
11 styleUrls: [ './video-miniature.component.scss' ],
12 templateUrl: './video-miniature.component.html'
13 })
14
15 export class VideoMiniatureComponent {
16 @Input() currentSort: SortField
17 @Input() user: User
18 @Input() video: Video
19
20 constructor (
21 private notificationsService: NotificationsService,
22 private confirmService: ConfirmService,
23 private configService: ConfigService,
24 private videoService: VideoService
25 ) {}
26
27 getVideoName () {
28 if (this.isVideoNSFWForThisUser()) {
29 return 'NSFW'
30 }
31
32 return this.video.name
33 }
34
35 isVideoNSFWForThisUser () {
36 return this.video.isVideoNSFWForUser(this.user)
37 }
38 }