diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video-format-utils.ts | 4 | ||||
-rw-r--r-- | server/models/video/video.ts | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 76d0445d4..c63285e25 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -67,6 +67,7 @@ function videoModelToFormattedJSON (video: VideoModel, options?: VideoFormatting | |||
67 | createdAt: video.createdAt, | 67 | createdAt: video.createdAt, |
68 | updatedAt: video.updatedAt, | 68 | updatedAt: video.updatedAt, |
69 | publishedAt: video.publishedAt, | 69 | publishedAt: video.publishedAt, |
70 | originallyPublishedAt: video.originallyPublishedAt, | ||
70 | account: { | 71 | account: { |
71 | id: formattedAccount.id, | 72 | id: formattedAccount.id, |
72 | uuid: formattedAccount.uuid, | 73 | uuid: formattedAccount.uuid, |
@@ -323,6 +324,9 @@ function videoModelToActivityPubObject (video: VideoModel): VideoTorrentObject { | |||
323 | commentsEnabled: video.commentsEnabled, | 324 | commentsEnabled: video.commentsEnabled, |
324 | downloadEnabled: video.downloadEnabled, | 325 | downloadEnabled: video.downloadEnabled, |
325 | published: video.publishedAt.toISOString(), | 326 | published: video.publishedAt.toISOString(), |
327 | originallyPublishedAt: video.originallyPublishedAt ? | ||
328 | video.originallyPublishedAt.toISOString() : | ||
329 | null, | ||
326 | updated: video.updatedAt.toISOString(), | 330 | updated: video.updatedAt.toISOString(), |
327 | mediaType: 'text/markdown', | 331 | mediaType: 'text/markdown', |
328 | content: video.getTruncatedDescription(), | 332 | content: video.getTruncatedDescription(), |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 0feeed4f8..73626b6a0 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -103,6 +103,7 @@ const indexes: Sequelize.DefineIndexesOptions[] = [ | |||
103 | 103 | ||
104 | { fields: [ 'createdAt' ] }, | 104 | { fields: [ 'createdAt' ] }, |
105 | { fields: [ 'publishedAt' ] }, | 105 | { fields: [ 'publishedAt' ] }, |
106 | { fields: [ 'originallyPublishedAt' ] }, | ||
106 | { fields: [ 'duration' ] }, | 107 | { fields: [ 'duration' ] }, |
107 | { fields: [ 'views' ] }, | 108 | { fields: [ 'views' ] }, |
108 | { fields: [ 'channelId' ] }, | 109 | { fields: [ 'channelId' ] }, |
@@ -740,6 +741,9 @@ export class VideoModel extends Model<VideoModel> { | |||
740 | @Column | 741 | @Column |
741 | publishedAt: Date | 742 | publishedAt: Date |
742 | 743 | ||
744 | @Column | ||
745 | originallyPublishedAt: Date | ||
746 | |||
743 | @ForeignKey(() => VideoChannelModel) | 747 | @ForeignKey(() => VideoChannelModel) |
744 | @Column | 748 | @Column |
745 | channelId: number | 749 | channelId: number |