diff options
Diffstat (limited to 'server/lib/activitypub/videos')
-rw-r--r-- | server/lib/activitypub/videos/shared/creator.ts | 1 | ||||
-rw-r--r-- | server/lib/activitypub/videos/shared/object-to-model-attributes.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/videos/updater.ts | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/server/lib/activitypub/videos/shared/creator.ts b/server/lib/activitypub/videos/shared/creator.ts index bc139e4fa..512d14d82 100644 --- a/server/lib/activitypub/videos/shared/creator.ts +++ b/server/lib/activitypub/videos/shared/creator.ts | |||
@@ -49,6 +49,7 @@ export class APVideoCreator extends APVideoAbstractBuilder { | |||
49 | user: undefined, | 49 | user: undefined, |
50 | isRemote: true, | 50 | isRemote: true, |
51 | isNew: true, | 51 | isNew: true, |
52 | isNewFile: true, | ||
52 | transaction: t | 53 | transaction: t |
53 | }) | 54 | }) |
54 | 55 | ||
diff --git a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts index a9e0bed97..6cbe72e27 100644 --- a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts +++ b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts | |||
@@ -231,6 +231,10 @@ function getVideoAttributesFromObject (videoChannel: MChannelId, videoObject: Vi | |||
231 | ? new Date(videoObject.originallyPublishedAt) | 231 | ? new Date(videoObject.originallyPublishedAt) |
232 | : null, | 232 | : null, |
233 | 233 | ||
234 | inputFileUpdatedAt: videoObject.uploadDate | ||
235 | ? new Date(videoObject.uploadDate) | ||
236 | : null, | ||
237 | |||
234 | updatedAt: new Date(videoObject.updated), | 238 | updatedAt: new Date(videoObject.updated), |
235 | views: videoObject.views, | 239 | views: videoObject.views, |
236 | remote: true, | 240 | remote: true, |
diff --git a/server/lib/activitypub/videos/updater.ts b/server/lib/activitypub/videos/updater.ts index 522d7b043..acb087895 100644 --- a/server/lib/activitypub/videos/updater.ts +++ b/server/lib/activitypub/videos/updater.ts | |||
@@ -38,6 +38,8 @@ export class APVideoUpdater extends APVideoAbstractBuilder { | |||
38 | { videoObject: this.videoObject, ...this.lTags() } | 38 | { videoObject: this.videoObject, ...this.lTags() } |
39 | ) | 39 | ) |
40 | 40 | ||
41 | const oldInputFileUpdatedAt = this.video.inputFileUpdatedAt | ||
42 | |||
41 | try { | 43 | try { |
42 | const channelActor = await this.getOrCreateVideoChannelFromVideoObject() | 44 | const channelActor = await this.getOrCreateVideoChannelFromVideoObject() |
43 | 45 | ||
@@ -74,6 +76,7 @@ export class APVideoUpdater extends APVideoAbstractBuilder { | |||
74 | user: undefined, | 76 | user: undefined, |
75 | isRemote: true, | 77 | isRemote: true, |
76 | isNew: false, | 78 | isNew: false, |
79 | isNewFile: oldInputFileUpdatedAt !== videoUpdated.inputFileUpdatedAt, | ||
77 | transaction: undefined | 80 | transaction: undefined |
78 | }) | 81 | }) |
79 | 82 | ||
@@ -129,6 +132,7 @@ export class APVideoUpdater extends APVideoAbstractBuilder { | |||
129 | this.video.createdAt = videoData.createdAt | 132 | this.video.createdAt = videoData.createdAt |
130 | this.video.publishedAt = videoData.publishedAt | 133 | this.video.publishedAt = videoData.publishedAt |
131 | this.video.originallyPublishedAt = videoData.originallyPublishedAt | 134 | this.video.originallyPublishedAt = videoData.originallyPublishedAt |
135 | this.video.inputFileUpdatedAt = videoData.inputFileUpdatedAt | ||
132 | this.video.privacy = videoData.privacy | 136 | this.video.privacy = videoData.privacy |
133 | this.video.channelId = videoData.channelId | 137 | this.video.channelId = videoData.channelId |
134 | this.video.views = videoData.views | 138 | this.video.views = videoData.views |