]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts
Filter videos by live in custom markup
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-custom-markup / peertube-custom-tags / playlist-miniature-markup.component.ts
CommitLineData
8b61dcaf 1import { finalize } from 'rxjs/operators'
0ca454e3 2import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
8b61dcaf 3import { Notifier } from '@app/core'
3da38d6e 4import { FindInBulkService } from '@app/shared/shared-search'
8ee25e17 5import { MiniatureDisplayOptions } from '../../shared-video-miniature'
3da38d6e 6import { VideoPlaylist } from '../../shared-video-playlist'
0ca454e3 7import { CustomMarkupComponent } from './shared'
2539932e
C
8
9/*
10 * Markup component that creates a playlist miniature only
11*/
12
13@Component({
14 selector: 'my-playlist-miniature-markup',
15 templateUrl: 'playlist-miniature-markup.component.html',
16 styleUrls: [ 'playlist-miniature-markup.component.scss' ]
17})
0ca454e3 18export class PlaylistMiniatureMarkupComponent implements CustomMarkupComponent, OnInit {
2539932e
C
19 @Input() uuid: string
20
0ca454e3
C
21 @Output() loaded = new EventEmitter<boolean>()
22
2539932e
C
23 playlist: VideoPlaylist
24
25 displayOptions: MiniatureDisplayOptions = {
26 date: true,
27 views: true,
28 by: true,
29 avatar: false,
30 privacyLabel: false,
31 privacyText: false,
32 state: false,
33 blacklistInfo: false
34 }
35
36 constructor (
3da38d6e 37 private findInBulkService: FindInBulkService,
8b61dcaf 38 private notifier: Notifier
2539932e
C
39 ) { }
40
41 ngOnInit () {
3da38d6e 42 this.findInBulkService.getPlaylist(this.uuid)
8b61dcaf
C
43 .pipe(finalize(() => this.loaded.emit(true)))
44 .subscribe(
45 playlist => this.playlist = playlist,
0ca454e3 46
ff4de383 47 err => this.notifier.error($localize`Error in playlist miniature component: ${err.message}`)
8b61dcaf 48 )
2539932e
C
49 }
50}