]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/video-edit.model.ts
Better error message in videos list
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video-edit.model.ts
index c5d5bb406a1649dc5ae631748baed2cc1e28eac1..67d8e7711d550da06e9dae5a24b3ca98b964b058 100644 (file)
@@ -57,7 +57,7 @@ export class VideoEdit implements VideoUpdate {
       this.previewUrl = video.previewUrl
 
       this.scheduleUpdate = video.scheduledUpdate
-      this.originallyPublishedAt = new Date(video.originallyPublishedAt)
+      this.originallyPublishedAt = video.originallyPublishedAt ? new Date(video.originallyPublishedAt) : null
     }
   }
 
@@ -85,6 +85,11 @@ export class VideoEdit implements VideoUpdate {
       const originallyPublishedAt = new Date(values['originallyPublishedAt'])
       this.originallyPublishedAt = originallyPublishedAt.toISOString()
     }
+
+    // Use the same file than the preview for the thumbnail
+    if (this.previewfile) {
+      this.thumbnailfile = this.previewfile
+    }
   }
 
   toFormPatch () {