aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/video-edit.model.ts
diff options
context:
space:
mode:
authorclementbrizard <clementbrizard53@gmail.com>2019-01-12 13:41:45 +0000
committerclementbrizard <clementbrizard53@gmail.com>2019-01-12 13:41:45 +0000
commitc80341655fce5e70ad6da7d812e2ddeb1f8ef7f2 (patch)
tree9f0415756552c5e4d4b18aee50bccbfaa75dd4c3 /client/src/app/shared/video/video-edit.model.ts
parent94a680c095b3007179820ac091189f639dd39e6b (diff)
downloadPeerTube-c80341655fce5e70ad6da7d812e2ddeb1f8ef7f2.tar.gz
PeerTube-c80341655fce5e70ad6da7d812e2ddeb1f8ef7f2.tar.zst
PeerTube-c80341655fce5e70ad6da7d812e2ddeb1f8ef7f2.zip
Change models
Diffstat (limited to 'client/src/app/shared/video/video-edit.model.ts')
-rw-r--r--client/src/app/shared/video/video-edit.model.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts
index fc772a3cf..9078bb5d2 100644
--- a/client/src/app/shared/video/video-edit.model.ts
+++ b/client/src/app/shared/video/video-edit.model.ts
@@ -25,6 +25,7 @@ export class VideoEdit implements VideoUpdate {
25 uuid?: string 25 uuid?: string
26 id?: number 26 id?: number
27 scheduleUpdate?: VideoScheduleUpdate 27 scheduleUpdate?: VideoScheduleUpdate
28 originallyPublishedAt?: Date | string
28 29
29 constructor (video?: Video & { tags: string[], commentsEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) { 30 constructor (video?: Video & { tags: string[], commentsEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {
30 if (video) { 31 if (video) {
@@ -46,6 +47,7 @@ export class VideoEdit implements VideoUpdate {
46 this.previewUrl = video.previewUrl 47 this.previewUrl = video.previewUrl
47 48
48 this.scheduleUpdate = video.scheduledUpdate 49 this.scheduleUpdate = video.scheduledUpdate
50 this.originallyPublishedAt = new Date(video.originallyPublishedAt)
49 } 51 }
50 } 52 }
51 53
@@ -67,6 +69,12 @@ export class VideoEdit implements VideoUpdate {
67 } else { 69 } else {
68 this.scheduleUpdate = null 70 this.scheduleUpdate = null
69 } 71 }
72
73 // Convert originallyPublishedAt to string so that function objectToFormData() works correctly
74 if (this.originallyPublishedAt) {
75 const originallyPublishedAt = new Date(values['originallyPublishedAt'])
76 this.originallyPublishedAt = originallyPublishedAt.toISOString()
77 }
70 } 78 }
71 79
72 toFormPatch () { 80 toFormPatch () {
@@ -82,7 +90,8 @@ export class VideoEdit implements VideoUpdate {
82 commentsEnabled: this.commentsEnabled, 90 commentsEnabled: this.commentsEnabled,
83 waitTranscoding: this.waitTranscoding, 91 waitTranscoding: this.waitTranscoding,
84 channelId: this.channelId, 92 channelId: this.channelId,
85 privacy: this.privacy 93 privacy: this.privacy,
94 originallyPublishedAt: this.originallyPublishedAt
86 } 95 }
87 96
88 // Special case if we scheduled an update 97 // Special case if we scheduled an update