1 import { Component, OnInit } from '@angular/core'
2 import { AuthService } from '@app/core'
3 import { NotificationsService } from 'angular2-notifications'
4 import { I18n } from '@ngx-translate/i18n-polyfill'
5 import { VideosOverview } from '@app/shared/overview/videos-overview.model'
6 import { OverviewService } from '@app/shared/overview'
7 import { Video } from '@app/shared/video/video.model'
10 selector: 'my-video-overview',
11 templateUrl: './video-overview.component.html',
12 styleUrls: [ './video-overview.component.scss' ]
14 export class VideoOverviewComponent implements OnInit {
15 overview: VideosOverview = {
24 private notificationsService: NotificationsService,
25 private authService: AuthService,
26 private overviewService: OverviewService
30 return this.authService.getUser()
34 this.overviewService.getVideosOverview()
37 this.overview = overview
40 this.overview.categories.length === 0 &&
41 this.overview.channels.length === 0 &&
42 this.overview.tags.length === 0
43 ) this.notResults = true
48 this.notificationsService.error('Error', err.text)
53 buildVideoChannelBy (object: { videos: Video[] }) {
54 return object.videos[0].byVideoChannel