+
+ it('Should search by live', async function () {
+ this.timeout(60000)
+
+ {
+ const newConfig = {
+ search: {
+ searchIndex: { enabled: false }
+ },
+ live: { enabled: true }
+ }
+ await server.config.updateCustomSubConfig({ newConfig })
+ }
+
+ {
+ const body = await command.advancedVideoSearch({ search: { isLive: true } })
+
+ expect(body.total).to.equal(0)
+ expect(body.data).to.have.lengthOf(0)
+ }
+
+ {
+ const liveCommand = server.live
+
+ const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.store.channel.id }
+ const live = await liveCommand.create({ fields: liveAttributes })
+
+ const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id })
+ await liveCommand.waitUntilPublished({ videoId: live.id })
+
+ const body = await command.advancedVideoSearch({ search: { isLive: true } })
+
+ expect(body.total).to.equal(1)
+ expect(body.data[0].name).to.equal('live')
+
+ await stopFfmpeg(ffmpegCommand)
+ }
+ })
+
+ after(async function () {
+ await cleanupTests([ server ])
+ })