aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r--client/src/app/shared/video/video-edit.model.ts11
-rw-r--r--client/src/app/shared/video/video.model.ts4
-rw-r--r--client/src/app/shared/video/video.service.ts4
3 files changed, 17 insertions, 2 deletions
diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts
index 18c62a1f9..c5d5bb406 100644
--- a/client/src/app/shared/video/video-edit.model.ts
+++ b/client/src/app/shared/video/video-edit.model.ts
@@ -26,6 +26,7 @@ export class VideoEdit implements VideoUpdate {
26 uuid?: string 26 uuid?: string
27 id?: number 27 id?: number
28 scheduleUpdate?: VideoScheduleUpdate 28 scheduleUpdate?: VideoScheduleUpdate
29 originallyPublishedAt?: Date | string
29 30
30 constructor ( 31 constructor (
31 video?: Video & { 32 video?: Video & {
@@ -56,6 +57,7 @@ export class VideoEdit implements VideoUpdate {
56 this.previewUrl = video.previewUrl 57 this.previewUrl = video.previewUrl
57 58
58 this.scheduleUpdate = video.scheduledUpdate 59 this.scheduleUpdate = video.scheduledUpdate
60 this.originallyPublishedAt = new Date(video.originallyPublishedAt)
59 } 61 }
60 } 62 }
61 63
@@ -77,6 +79,12 @@ export class VideoEdit implements VideoUpdate {
77 } else { 79 } else {
78 this.scheduleUpdate = null 80 this.scheduleUpdate = null
79 } 81 }
82
83 // Convert originallyPublishedAt to string so that function objectToFormData() works correctly
84 if (this.originallyPublishedAt) {
85 const originallyPublishedAt = new Date(values['originallyPublishedAt'])
86 this.originallyPublishedAt = originallyPublishedAt.toISOString()
87 }
80 } 88 }
81 89
82 toFormPatch () { 90 toFormPatch () {
@@ -93,7 +101,8 @@ export class VideoEdit implements VideoUpdate {
93 downloadEnabled: this.downloadEnabled, 101 downloadEnabled: this.downloadEnabled,
94 waitTranscoding: this.waitTranscoding, 102 waitTranscoding: this.waitTranscoding,
95 channelId: this.channelId, 103 channelId: this.channelId,
96 privacy: this.privacy 104 privacy: this.privacy,
105 originallyPublishedAt: this.originallyPublishedAt
97 } 106 }
98 107
99 // Special case if we scheduled an update 108 // Special case if we scheduled an update
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts
index 6ea83d13b..460c09258 100644
--- a/client/src/app/shared/video/video.model.ts
+++ b/client/src/app/shared/video/video.model.ts
@@ -17,6 +17,7 @@ export class Video implements VideoServerModel {
17 createdAt: Date 17 createdAt: Date
18 updatedAt: Date 18 updatedAt: Date
19 publishedAt: Date 19 publishedAt: Date
20 originallyPublishedAt: Date | string
20 category: VideoConstant<number> 21 category: VideoConstant<number>
21 licence: VideoConstant<number> 22 licence: VideoConstant<number>
22 language: VideoConstant<string> 23 language: VideoConstant<string>
@@ -116,6 +117,9 @@ export class Video implements VideoServerModel {
116 this.privacy.label = peertubeTranslate(this.privacy.label, translations) 117 this.privacy.label = peertubeTranslate(this.privacy.label, translations)
117 118
118 this.scheduledUpdate = hash.scheduledUpdate 119 this.scheduledUpdate = hash.scheduledUpdate
120 this.originallyPublishedAt = hash.originallyPublishedAt ?
121 new Date(hash.originallyPublishedAt.toString())
122 : null
119 if (this.state) this.state.label = peertubeTranslate(this.state.label, translations) 123 if (this.state) this.state.label = peertubeTranslate(this.state.label, translations)
120 124
121 this.blacklisted = hash.blacklisted 125 this.blacklisted = hash.blacklisted
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts
index 565aad93b..960846e21 100644
--- a/client/src/app/shared/video/video.service.ts
+++ b/client/src/app/shared/video/video.service.ts
@@ -81,6 +81,7 @@ export class VideoService implements VideosProvider {
81 const description = video.description || null 81 const description = video.description || null
82 const support = video.support || null 82 const support = video.support || null
83 const scheduleUpdate = video.scheduleUpdate || null 83 const scheduleUpdate = video.scheduleUpdate || null
84 const originallyPublishedAt = video.originallyPublishedAt || null
84 85
85 const body: VideoUpdate = { 86 const body: VideoUpdate = {
86 name: video.name, 87 name: video.name,
@@ -98,7 +99,8 @@ export class VideoService implements VideosProvider {
98 downloadEnabled: video.downloadEnabled, 99 downloadEnabled: video.downloadEnabled,
99 thumbnailfile: video.thumbnailfile, 100 thumbnailfile: video.thumbnailfile,
100 previewfile: video.previewfile, 101 previewfile: video.previewfile,
101 scheduleUpdate 102 scheduleUpdate,
103 originallyPublishedAt
102 } 104 }
103 105
104 const data = objectToFormData(body) 106 const data = objectToFormData(body)