diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-16 14:19:43 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-16 14:19:43 +0100 |
commit | 1ab6024345c8a4dd98588c55af9a218b77c8b714 (patch) | |
tree | 427fbe7a4943046ae353d7d0814a51e05b0cbb8f | |
parent | ddca2576997e2769d8cc37bbfe3098591add13dd (diff) | |
download | PeerTube-1ab6024345c8a4dd98588c55af9a218b77c8b714.tar.gz PeerTube-1ab6024345c8a4dd98588c55af9a218b77c8b714.tar.zst PeerTube-1ab6024345c8a4dd98588c55af9a218b77c8b714.zip |
Fix live badge in videos list
-rw-r--r-- | server/models/video/video.ts | 1 | ||||
-rw-r--r-- | server/tests/api/live/live.ts | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index d3fed338a..abf823d4b 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1602,6 +1602,7 @@ export class VideoModel extends Model { | |||
1602 | 'likes', | 1602 | 'likes', |
1603 | 'dislikes', | 1603 | 'dislikes', |
1604 | 'remote', | 1604 | 'remote', |
1605 | 'isLive', | ||
1605 | 'url', | 1606 | 'url', |
1606 | 'commentsEnabled', | 1607 | 'commentsEnabled', |
1607 | 'downloadEnabled', | 1608 | 'downloadEnabled', |
diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index 939285ae8..f6b6d7677 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts | |||
@@ -116,6 +116,8 @@ describe('Test live', function () { | |||
116 | expect(video.channel.name).to.equal(servers[0].videoChannel.name) | 116 | expect(video.channel.name).to.equal(servers[0].videoChannel.name) |
117 | expect(video.channel.host).to.equal(servers[0].videoChannel.host) | 117 | expect(video.channel.host).to.equal(servers[0].videoChannel.host) |
118 | 118 | ||
119 | expect(video.isLive).to.be.true | ||
120 | |||
119 | expect(video.nsfw).to.be.false | 121 | expect(video.nsfw).to.be.false |
120 | expect(video.waitTranscoding).to.be.false | 122 | expect(video.waitTranscoding).to.be.false |
121 | expect(video.name).to.equal('my super live') | 123 | expect(video.name).to.equal('my super live') |
@@ -269,6 +271,20 @@ describe('Test live', function () { | |||
269 | await testFfmpegStreamError(command, false) | 271 | await testFfmpegStreamError(command, false) |
270 | }) | 272 | }) |
271 | 273 | ||
274 | it('Should list this live now someone stream into it', async function () { | ||
275 | for (const server of servers) { | ||
276 | const res = await getVideosList(server.url) | ||
277 | |||
278 | expect(res.body.total).to.equal(1) | ||
279 | expect(res.body.data).to.have.lengthOf(1) | ||
280 | |||
281 | const video: Video = res.body.data[0] | ||
282 | |||
283 | expect(video.name).to.equal('user live') | ||
284 | expect(video.isLive).to.be.true | ||
285 | } | ||
286 | }) | ||
287 | |||
272 | it('Should not allow a stream on a live that was blacklisted', async function () { | 288 | it('Should not allow a stream on a live that was blacklisted', async function () { |
273 | this.timeout(30000) | 289 | this.timeout(30000) |
274 | 290 | ||