+
+ // If schedule publication, the video is private and will be changed to public privacy
+ if (parseInt(values['privacy'], 10) === VideoEdit.SPECIAL_SCHEDULED_PRIVACY) {
+ const updateAt = new Date(values['schedulePublicationAt'])
+ updateAt.setSeconds(0)
+
+ this.privacy = VideoPrivacy.PRIVATE
+ this.scheduleUpdate = {
+ updateAt: updateAt.toISOString(),
+ privacy: VideoPrivacy.PUBLIC
+ }
+ } else {
+ this.scheduleUpdate = null
+ }
+
+ // Convert originallyPublishedAt to string so that function objectToFormData() works correctly
+ if (this.originallyPublishedAt) {
+ 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
+ }