Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Auto update publishedAt in live restream

Chocobozzz7137377d097a
diff --git a/server/lib/live/live-manager.ts b/server/lib/live/live-manager.ts
index b3bf5a999a..33e49acc1b 100644
--- a/server/lib/live/live-manager.ts
+++ b/server/lib/live/live-manager.ts
@@ -343,6 +343,7 @@ class LiveManager {
logger.info('Will publish and federate live %s.', video.url, localLTags)
video.state = VideoState.PUBLISHED
+ video.publishedAt = new Date()
await video.save()
live.Video = video
diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts
index f07d4cfecc..c5f942901d 100644
--- a/server/tests/api/live/live-permanent.ts
+++ b/server/tests/api/live/live-permanent.ts
@@ -101,6 +101,7 @@ describe('Permanent live', function () {
it('Should stream into this permanent live', async function () {
this.timeout(120000)
+ const beforePublication = new Date()
const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: videoUUID })
for (const server of servers) {
@@ -109,6 +110,11 @@ describe('Permanent live', function () {
await checkVideoState(videoUUID, VideoState.PUBLISHED)
+ for (const server of servers) {
+ const video = await server.videos.get({ id: videoUUID })
+ expect(new Date(video.publishedAt)).greaterThan(beforePublication)
+ }
+
await stopFfmpeg(ffmpegCommand)
await servers[0].live.waitUntilWaiting({ videoId: videoUUID })