Skip to content

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

Fix live badge in videos list

Chocobozzz1ab6024345c8
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index d3fed338a7..abf823d4b6 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -1602,6 +1602,7 @@ export class VideoModel extends Model {
'likes',
'dislikes',
'remote',
+ 'isLive',
'url',
'commentsEnabled',
'downloadEnabled',
diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts
index 939285ae85..f6b6d76779 100644
--- a/server/tests/api/live/live.ts
+++ b/server/tests/api/live/live.ts
@@ -116,6 +116,8 @@ describe('Test live', function () {
expect(video.channel.name).to.equal(servers[0].videoChannel.name)
expect(video.channel.host).to.equal(servers[0].videoChannel.host)
+ expect(video.isLive).to.be.true
+
expect(video.nsfw).to.be.false
expect(video.waitTranscoding).to.be.false
expect(video.name).to.equal('my super live')
@@ -269,6 +271,20 @@ describe('Test live', function () {
await testFfmpegStreamError(command, false)
})
+ it('Should list this live now someone stream into it', async function () {
+ for (const server of servers) {
+ const res = await getVideosList(server.url)
+
+ expect(res.body.total).to.equal(1)
+ expect(res.body.data).to.have.lengthOf(1)
+
+ const video: Video = res.body.data[0]
+
+ expect(video.name).to.equal('user live')
+ expect(video.isLive).to.be.true
+ }
+ })
+
it('Should not allow a stream on a live that was blacklisted', async function () {
this.timeout(30000)