import { LinkType } from 'src/types/link.type'
import { Component, Input, OnInit } from '@angular/core'
import { VideoPlaylist } from './video-playlist.model'
+import { MarkdownService } from '@app/core'
@Component({
selector: 'my-video-playlist-miniature',
routerLink: any
playlistHref: string
playlistTarget: string
+ playlistDescription: string
- ngOnInit () {
+ constructor (
+ private markdownService: MarkdownService
+ ) {}
+
+ async ngOnInit () {
this.buildPlaylistUrl()
+ if (this.displayDescription) {
+ this.playlistDescription = await this.markdownService.textMarkdownToHTML({ markdown: this.playlist.description })
+ }
}
buildPlaylistUrl () {
}
if (this.linkType === 'internal' || !this.playlist.url) {
- this.routerLink = [ '/w/p', this.playlist.uuid ]
+ this.routerLink = VideoPlaylist.buildWatchUrl(this.playlist)
return
}