1 import { LinkType } from 'src/types/link.type'
2 import { Component, Input, OnInit } from '@angular/core'
3 import { VideoPlaylist } from './video-playlist.model'
6 selector: 'my-video-playlist-miniature',
7 styleUrls: [ './video-playlist-miniature.component.scss' ],
8 templateUrl: './video-playlist-miniature.component.html'
10 export class VideoPlaylistMiniatureComponent implements OnInit {
11 @Input() playlist: VideoPlaylist
13 @Input() toManage = false
15 @Input() displayChannel = false
16 @Input() displayDescription = false
17 @Input() displayPrivacy = false
18 @Input() displayAsRow = false
20 @Input() linkType: LinkType = 'internal'
24 playlistTarget: string
27 this.buildPlaylistUrl()
32 this.routerLink = [ '/my-library/video-playlists', this.playlist.uuid ]
36 if (this.playlist.videosLength === 0) {
37 this.routerLink = null
41 if (this.linkType === 'internal' || !this.playlist.url) {
42 this.routerLink = [ '/w/p', this.playlist.uuid ]
46 if (this.linkType === 'external') {
47 this.routerLink = null
48 this.playlistHref = this.playlist.url
49 this.playlistTarget = '_blank'
54 this.routerLink = [ '/search/lazy-load-playlist', { url: this.playlist.url } ]