diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts
index c5d5bb406..1f633d427 100644
--- a/client/src/app/shared/video/video-edit.model.ts
+++ b/client/src/app/shared/video/video-edit.model.ts
@@ -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
}
}
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html
index 2fb540170..1be1084ad 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html
@@ -114,20 +114,6 @@
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
index 836452948..c7ebcec25 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
@@ -26,7 +26,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
@Input() videoPrivacies: VideoConstant
[] = []
@Input() userVideoChannels: { id: number, label: string, support: string }[] = []
@Input() schedulePublicationPossible = true
- @Input() videoCaptions: VideoCaptionEdit[] = []
+ @Input() videoCaptions: (VideoCaptionEdit & { captionPath?: string })[] = []
@Input() waitTranscodingEnabled = true
@ViewChild('videoCaptionAddModal') videoCaptionAddModal: VideoCaptionAddModalComponent
diff --git a/server/initializers/migrations/0340-add-originally-published-at.ts b/server/initializers/migrations/0340-add-originally-published-at.ts
index ab8d66854..fe4f4a5f9 100644
--- a/server/initializers/migrations/0340-add-originally-published-at.ts
+++ b/server/initializers/migrations/0340-add-originally-published-at.ts
@@ -6,19 +6,13 @@ async function up (utils: {
sequelize: Sequelize.Sequelize
}): Promise {
- {
- const data = {
- type: Sequelize.DATE,
- allowNull: true,
- defaultValue: Sequelize.NOW
- }
- await utils.queryInterface.addColumn('video', 'originallyPublishedAt', data)
+ const data = {
+ type: Sequelize.DATE,
+ allowNull: true,
+ defaultValue: null
}
+ await utils.queryInterface.addColumn('video', 'originallyPublishedAt', data)
- {
- const query = 'UPDATE video SET "originallyPublishedAt" = video."publishedAt"'
- await utils.sequelize.query(query)
- }
}
function down (options) {