ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix publishedAt value after following a new instance
Chocobozzz53a613171e5d
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.tsindex be6794cef9..907f7e11e2 100644--- a/server/lib/activitypub/videos.ts+++ b/server/lib/activitypub/videos.ts@@ -93,6 +93,7 @@ async function videoActivityObjectToDBAttributes (videoChannel: VideoChannelModechannelId: videoChannel.id,duration: parseInt(duration, 10),createdAt: new Date(videoObject.published),+ publishedAt: new Date(videoObject.published),// FIXME: updatedAt does not seems to be considered by SequelizeupdatedAt: new Date(videoObject.updated),views: videoObject.views,diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.tsindex 94d627e263..fc7c0cb21c 100644--- a/server/tests/api/videos/multiple-servers.ts+++ b/server/tests/api/videos/multiple-servers.ts@@ -105,6 +105,7 @@ describe('Test multiple servers', function () {await wait(10000)// All servers should have this video+ let publishedAt: string = nullfor (const server of servers) {const isLocal = server.url === 'http://localhost:9001'const checkAttributes = {@@ -120,6 +121,7 @@ describe('Test multiple servers', function () {host: 'localhost:9001'},isLocal,+ publishedAt,duration: 10,tags: [ 'tag1p1', 'tag2p1' ],privacy: VideoPrivacy.PUBLIC,@@ -145,6 +147,7 @@ describe('Test multiple servers', function () {const video = videos[0]await completeVideoCheck(server.url, video, checkAttributes)+ publishedAt = video.publishedAt}})diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.tsindex 46fa5f79d3..746b5ca6b5 100644--- a/server/tests/utils/videos/videos.ts+++ b/server/tests/utils/videos/videos.ts@@ -447,6 +447,7 @@ async function completeVideoCheck (nsfw: booleancommentsEnabled: booleandescription: string+ publishedAt?: stringsupport: stringaccount: {name: string@@ -500,6 +501,12 @@ async function completeVideoCheck (expect(dateIsValid(video.publishedAt)).to.be.trueexpect(dateIsValid(video.updatedAt)).to.be.true+ if (attributes.publishedAt) {+ console.log(attributes.publishedAt)+ console.log(video.publishedAt)+ expect(video.publishedAt).to.equal(attributes.publishedAt)+ }+const res = await getVideo(url, video.uuid)const videoDetails: VideoDetails = res.body