+ describe('Live filters', function () {
+ let ffmpegCommand: any
+ let liveVideoId: string
+ let vodVideoId: string
+
+ before(async function () {
+ this.timeout(120000)
+
+ vodVideoId = (await servers[0].videos.quickUpload({ name: 'vod video' })).uuid
+
+ const liveOptions = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: servers[0].store.channel.id }
+ const live = await commands[0].create({ fields: liveOptions })
+ liveVideoId = live.uuid
+
+ ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: liveVideoId })
+ await waitUntilLivePublishedOnAllServers(servers, liveVideoId)
+ await waitJobs(servers)
+ })
+
+ it('Should only display lives', async function () {
+ const { data, total } = await servers[0].videos.list({ isLive: true })
+
+ expect(total).to.equal(1)
+ expect(data).to.have.lengthOf(1)
+ expect(data[0].name).to.equal('live')
+ })
+
+ it('Should not display lives', async function () {
+ const { data, total } = await servers[0].videos.list({ isLive: false })
+
+ expect(total).to.equal(1)
+ expect(data).to.have.lengthOf(1)
+ expect(data[0].name).to.equal('vod video')
+ })
+
+ it('Should display my lives', async function () {
+ this.timeout(60000)
+
+ await stopFfmpeg(ffmpegCommand)
+ await waitJobs(servers)
+
+ const { data } = await servers[0].videos.listMyVideos({ isLive: true })
+
+ const result = data.every(v => v.isLive)
+ expect(result).to.be.true
+ })
+
+ it('Should not display my lives', async function () {
+ const { data } = await servers[0].videos.listMyVideos({ isLive: false })
+
+ const result = data.every(v => !v.isLive)
+ expect(result).to.be.true
+ })
+
+ after(async function () {
+ await servers[0].videos.remove({ id: vodVideoId })
+ await servers[0].videos.remove({ id: liveVideoId })
+ })
+ })
+