]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / shared / metadata / video-description.component.ts
index b554567d922252222808410efac2c604606f9147..e002b3c2212d36e4b090e9d68d44bc6b3d0188b9 100644 (file)
@@ -1,4 +1,4 @@
-import { Component, EventEmitter, Inject, Input, LOCALE_ID, OnChanges, Output } from '@angular/core'
+import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'
 import { MarkdownService, Notifier } from '@app/core'
 import { VideoDetails, VideoService } from '@app/shared/shared-main'
 
@@ -21,8 +21,7 @@ export class VideoDescriptionComponent implements OnChanges {
   constructor (
     private videoService: VideoService,
     private notifier: Notifier,
-    private markdownService: MarkdownService,
-    @Inject(LOCALE_ID) private localeId: string
+    private markdownService: MarkdownService
   ) { }
 
   ngOnChanges () {
@@ -51,8 +50,8 @@ export class VideoDescriptionComponent implements OnChanges {
     this.descriptionLoading = true
 
     this.videoService.loadCompleteDescription(this.video.descriptionPath)
-        .subscribe(
-          description => {
+        .subscribe({
+          next: description => {
             this.completeDescriptionShown = true
             this.descriptionLoading = false
 
@@ -62,11 +61,11 @@ export class VideoDescriptionComponent implements OnChanges {
             this.updateVideoDescription(this.completeVideoDescription)
           },
 
-          error => {
+          error: err => {
             this.descriptionLoading = false
-            this.notifier.error(error.message)
+            this.notifier.error(err.message)
           }
-        )
+        })
   }
 
   onTimestampClicked (timestamp: number) {
@@ -81,6 +80,7 @@ export class VideoDescriptionComponent implements OnChanges {
 
   private async setVideoDescriptionHTML () {
     const html = await this.markdownService.textMarkdownToHTML(this.video.description)
-    this.videoHTMLDescription = this.markdownService.processVideoTimestamps(html)
+
+    this.videoHTMLDescription = this.markdownService.processVideoTimestamps(this.video.shortUUID, html)
   }
 }