+
+ it('Should be able to filter by channel in my videos', async function () {
+ const myInfo = await server.users.getMyInfo({ token: userToken })
+ const mainChannel = myInfo.videoChannels.find(c => c.name !== 'other_channel')
+ const otherChannel = myInfo.videoChannels.find(c => c.name === 'other_channel')
+
+ {
+ const { total, data } = await server.videos.listMyVideos({ token: userToken, channelId: mainChannel.id })
+ expect(total).to.equal(1)
+ expect(data).to.have.lengthOf(1)
+
+ const video: Video = data[0]
+ expect(video.name).to.equal('super user video')
+ expect(video.thumbnailPath).to.not.be.null
+ expect(video.previewPath).to.not.be.null
+ }
+
+ {
+ const { total, data } = await server.videos.listMyVideos({ token: userToken, channelId: otherChannel.id })
+ expect(total).to.equal(0)
+ expect(data).to.have.lengthOf(0)
+ }
+ })
+
+ it('Should be able to search in my videos', async function () {
+ {
+ const { total, data } = await server.videos.listMyVideos({ token: userToken, sort: '-createdAt', search: 'user video' })
+ expect(total).to.equal(1)
+ expect(data).to.have.lengthOf(1)
+ }
+
+ {
+ const { total, data } = await server.videos.listMyVideos({ token: userToken, sort: '-createdAt', search: 'toto' })
+ expect(total).to.equal(0)
+ expect(data).to.have.lengthOf(0)
+ }
+ })
+
+ it('Should disable webtorrent, enable HLS, and update my quota', async function () {
+ this.timeout(60000)
+
+ {
+ const config = await server.config.getCustomConfig()
+ config.transcoding.webtorrent.enabled = false
+ config.transcoding.hls.enabled = true
+ config.transcoding.enabled = true
+ await server.config.updateCustomSubConfig({ newConfig: config })
+ }
+
+ {
+ const attributes = {
+ name: 'super user video 2',
+ fixture: 'video_short.webm'
+ }
+ await server.videos.upload({ token: userToken, attributes })
+
+ await waitJobs([ server ])
+ }
+
+ {
+ const data = await server.users.getMyQuotaUsed({ token: userToken })
+ expect(data.videoQuotaUsed).to.be.greaterThan(220000)
+ }
+ })