- toFormattedJSON (options?: {
- additionalAttributes: {
- state?: boolean,
- waitTranscoding?: boolean,
- scheduledUpdate?: boolean
- }
- }): Video {
- const formattedAccount = this.VideoChannel.Account.toFormattedJSON()
- const formattedVideoChannel = this.VideoChannel.toFormattedJSON()
-
- const videoObject: Video = {
- id: this.id,
- uuid: this.uuid,
- name: this.name,
- category: {
- id: this.category,
- label: VideoModel.getCategoryLabel(this.category)
- },
- licence: {
- id: this.licence,
- label: VideoModel.getLicenceLabel(this.licence)
- },
- language: {
- id: this.language,
- label: VideoModel.getLanguageLabel(this.language)
- },
- privacy: {
- id: this.privacy,
- label: VideoModel.getPrivacyLabel(this.privacy)
- },
- nsfw: this.nsfw,
- description: this.getTruncatedDescription(),
- isLocal: this.isOwned(),
- duration: this.duration,
- views: this.views,
- likes: this.likes,
- dislikes: this.dislikes,
- thumbnailPath: this.getThumbnailStaticPath(),
- previewPath: this.getPreviewStaticPath(),
- embedPath: this.getEmbedStaticPath(),
- createdAt: this.createdAt,
- updatedAt: this.updatedAt,
- publishedAt: this.publishedAt,
- account: {
- id: formattedAccount.id,
- uuid: formattedAccount.uuid,
- name: formattedAccount.name,
- displayName: formattedAccount.displayName,
- url: formattedAccount.url,
- host: formattedAccount.host,
- avatar: formattedAccount.avatar
- },
- channel: {
- id: formattedVideoChannel.id,
- uuid: formattedVideoChannel.uuid,
- name: formattedVideoChannel.name,
- displayName: formattedVideoChannel.displayName,
- url: formattedVideoChannel.url,
- host: formattedVideoChannel.host,
- avatar: formattedVideoChannel.avatar
- }
- }