uuid?: string
id?: number
scheduleUpdate?: VideoScheduleUpdate
+ originallyPublishedAt?: Date | string
constructor (video?: Video & { tags: string[], commentsEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {
if (video) {
this.previewUrl = video.previewUrl
this.scheduleUpdate = video.scheduledUpdate
+ this.originallyPublishedAt = new Date(video.originallyPublishedAt)
}
}
} 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()
+ }
}
toFormPatch () {
commentsEnabled: this.commentsEnabled,
waitTranscoding: this.waitTranscoding,
channelId: this.channelId,
- privacy: this.privacy
+ privacy: this.privacy,
+ originallyPublishedAt: this.originallyPublishedAt
}
// Special case if we scheduled an update
createdAt: Date
updatedAt: Date
publishedAt: Date
+ originallyPublishedAt: Date | string
category: VideoConstant<number>
licence: VideoConstant<number>
language: VideoConstant<string>
this.privacy.label = peertubeTranslate(this.privacy.label, translations)
this.scheduledUpdate = hash.scheduledUpdate
+ this.originallyPublishedAt = hash.originallyPublishedAt ?
+ new Date(hash.originallyPublishedAt.toString())
+ : null
if (this.state) this.state.label = peertubeTranslate(this.state.label, translations)
this.blacklisted = hash.blacklisted
createdAt: video.createdAt,
updatedAt: video.updatedAt,
publishedAt: video.publishedAt,
+ originallyPublishedAt: video.originallyPublishedAt,
account: {
id: formattedAccount.id,
uuid: formattedAccount.uuid,
state: video.state,
commentsEnabled: video.commentsEnabled,
published: video.publishedAt.toISOString(),
+ originallyPublishedAt: video.originallyPublishedAt ?
+ video.originallyPublishedAt.toISOString() :
+ null,
updated: video.updatedAt.toISOString(),
mediaType: 'text/markdown',
content: video.getTruncatedDescription(),
{ fields: [ 'createdAt' ] },
{ fields: [ 'publishedAt' ] },
+ { fields: [ 'originallyPublishedAt' ] },
{ fields: [ 'duration' ] },
{ fields: [ 'views' ] },
{ fields: [ 'channelId' ] },
@Column
publishedAt: Date
+ @Column
+ originallyPublishedAt: Date
+
@ForeignKey(() => VideoChannelModel)
@Column
channelId: number
waitTranscoding: boolean
state: VideoState
published: string
+ originallyPublishedAt: string
updated: string
mediaType: 'text/markdown'
content: string
commentsEnabled?: boolean
privacy: VideoPrivacy
scheduleUpdate?: VideoScheduleUpdate
+ originallyPublishedAt: Date | string
}
thumbnailfile?: Blob
previewfile?: Blob
scheduleUpdate?: VideoScheduleUpdate
+ originallyPublishedAt?: Date | string
}
createdAt: Date | string
updatedAt: Date | string
publishedAt: Date | string
+ originallyPublishedAt: Date | string
category: VideoConstant<number>
licence: VideoConstant<number>
language: VideoConstant<string>