aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/videos/video-list/video-miniature.component.ts
blob: 8d8b817ee494a439124b2205a6f4fbf71ca81a1b (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                
 
                                            
                                   


                                 

                                                    
  
                                      


                                 
 



                                        
 
                          

   

                                                   
   
 
import { Component, Input } from '@angular/core'

import { SortField, Video } from '../shared'
import { User } from '../../shared'

@Component({
  selector: 'my-video-miniature',
  styleUrls: [ './video-miniature.component.scss' ],
  templateUrl: './video-miniature.component.html'
})
export class VideoMiniatureComponent {
  @Input() currentSort: SortField
  @Input() user: User
  @Input() video: Video

  getVideoName () {
    if (this.isVideoNSFWForThisUser()) {
      return 'NSFW'
    }

    return this.video.name
  }

  isVideoNSFWForThisUser () {
    return this.video.isVideoNSFWForUser(this.user)
  }
}