1 import { Component, OnInit } from '@angular/core'
2 import { AuthService, Notifier } from '@app/core'
3 import { I18n } from '@ngx-translate/i18n-polyfill'
4 import { VideosOverview } from '@app/shared/overview/videos-overview.model'
5 import { OverviewService } from '@app/shared/overview'
6 import { Video } from '@app/shared/video/video.model'
9 selector: 'my-video-overview',
10 templateUrl: './video-overview.component.html',
11 styleUrls: [ './video-overview.component.scss' ]
13 export class VideoOverviewComponent implements OnInit {
14 overview: VideosOverview = {
23 private notifier: Notifier,
24 private authService: AuthService,
25 private overviewService: OverviewService
29 return this.authService.getUser()
33 this.overviewService.getVideosOverview()
36 this.overview = overview
39 this.overview.categories.length === 0 &&
40 this.overview.channels.length === 0 &&
41 this.overview.tags.length === 0
42 ) this.notResults = true
45 err => this.notifier.error(err.message)
49 buildVideoChannelBy (object: { videos: Video[] }) {
50 return object.videos[0].byVideoChannel
53 buildVideoChannelAvatarUrl (object: { videos: Video[] }) {
54 return object.videos[0].videoChannelAvatarUrl