1
0
Fork 0
peertube/client/src/app/videos/video-list/video-miniature.component.ts

38 lines
977 B
TypeScript
Raw Normal View History

import { Component, Input, Output, EventEmitter } from '@angular/core';
import { NotificationsService } from 'angular2-notifications';
2017-04-04 15:37:03 -04:00
import { ConfirmService, ConfigService } from '../../core';
2016-07-18 09:39:10 -04:00
import { SortField, Video, VideoService } from '../shared';
import { User } from '../../shared';
@Component({
selector: 'my-video-miniature',
styleUrls: [ './video-miniature.component.scss' ],
templateUrl: './video-miniature.component.html'
})
export class VideoMiniatureComponent {
2016-07-18 09:39:10 -04:00
@Input() currentSort: SortField;
@Input() user: User;
2016-05-27 11:49:18 -04:00
@Input() video: Video;
constructor(
private notificationsService: NotificationsService,
private confirmService: ConfirmService,
2017-04-04 15:37:03 -04:00
private configService: ConfigService,
private videoService: VideoService
) {}
2017-04-04 15:37:03 -04:00
getVideoName() {
if (this.isVideoNSFWForThisUser())
return 'NSFW';
return this.video.name;
}
isVideoNSFWForThisUser() {
return this.video.isVideoNSFWForUser(this.user);
}
}