]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts
Only display homepage when components are loaded
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-custom-markup / peertube-custom-tags / playlist-miniature-markup.component.ts
1 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2 import { MiniatureDisplayOptions } from '../../shared-video-miniature'
3 import { VideoPlaylist, VideoPlaylistService } from '../../shared-video-playlist'
4 import { CustomMarkupComponent } from './shared'
5
6 /*
7 * Markup component that creates a playlist miniature only
8 */
9
10 @Component({
11 selector: 'my-playlist-miniature-markup',
12 templateUrl: 'playlist-miniature-markup.component.html',
13 styleUrls: [ 'playlist-miniature-markup.component.scss' ]
14 })
15 export class PlaylistMiniatureMarkupComponent implements CustomMarkupComponent, OnInit {
16 @Input() uuid: string
17
18 @Output() loaded = new EventEmitter<boolean>()
19
20 playlist: VideoPlaylist
21
22 displayOptions: MiniatureDisplayOptions = {
23 date: true,
24 views: true,
25 by: true,
26 avatar: false,
27 privacyLabel: false,
28 privacyText: false,
29 state: false,
30 blacklistInfo: false
31 }
32
33 constructor (
34 private playlistService: VideoPlaylistService
35 ) { }
36
37 ngOnInit () {
38 this.playlistService.getVideoPlaylist(this.uuid)
39 .subscribe({
40 next: playlist => this.playlist = playlist,
41
42 complete: () => this.loaded.emit(true)
43 })
44 }
45 }