+ expect(body.total).to.equal(1)
+ expect(body.data[0].name).to.equal('1111 2222 3333 - 3')
+ })
+
+ it('Should filter by UUIDs', async function () {
+ for (const uuid of [ videoUUID, videoShortUUID ]) {
+ const body = await command.advancedVideoSearch({ search: { uuids: [ uuid ] } })
+
+ expect(body.total).to.equal(1)
+ expect(body.data[0].name).to.equal('1111 2222 3333 - 3')
+ }
+
+ {
+ const body = await command.advancedVideoSearch({ search: { uuids: [ 'dfd70b83-639f-4980-94af-304a56ab4b35' ] } })
+
+ expect(body.total).to.equal(0)
+ expect(body.data).to.have.lengthOf(0)
+ }
+ })
+
+ it('Should search by host', async function () {
+ {
+ const body = await command.advancedVideoSearch({ search: { search: '6666 7777 8888', host: server.host } })
+ expect(body.total).to.equal(1)
+ expect(body.data[0].name).to.equal('6666 7777 8888')
+ }
+
+ {
+ const body = await command.advancedVideoSearch({ search: { search: '1111', host: 'example.com' } })
+ expect(body.total).to.equal(0)
+ expect(body.data).to.have.lengthOf(0)
+ }
+
+ {
+ const body = await command.advancedVideoSearch({ search: { search: 'remote', host: remoteServer.host } })
+ expect(body.total).to.equal(2)
+ expect(body.data).to.have.lengthOf(2)
+ expect(body.data[0].name).to.equal('remote video 1')
+ expect(body.data[1].name).to.equal('remote video 2')
+ }
+ })
+
+ 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)
+ }