- expect(video.name).to.equal('my super name')
- expect(video.category).to.equal(2)
- expect(video.categoryLabel).to.equal('Films')
- expect(video.licence).to.equal(6)
- expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
- expect(video.language).to.equal(3)
- expect(video.languageLabel).to.equal('Mandarin')
- expect(video.nsfw).to.be.ok
- expect(video.description).to.equal('my super description')
- expect(video.serverHost).to.equal('localhost:9001')
- expect(video.accountName).to.equal('root')
- expect(video.isLocal).to.be.true
- expect(dateIsValid(video.createdAt)).to.be.true
- expect(dateIsValid(video.updatedAt)).to.be.true
-
- const res2 = await getVideo(server.url, res.body.data[0].id)
- const videoDetails = res2.body
-
- expect(videoDetails.files).to.have.lengthOf(1)
-
- const file = videoDetails.files[0]
- const magnetUri = file.magnetUri
- expect(file.magnetUri).to.have.lengthOf.above(2)
- expect(file.torrentUrl).to.equal(`${server.url}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`)
- expect(file.fileUrl).to.equal(`${server.url}/static/webseed/${videoDetails.uuid}-${file.resolution}.webm`)
- expect(file.resolution).to.equal(720)
- expect(file.resolutionLabel).to.equal('720p')
- expect(file.size).to.equal(218910)
-
- const test = await testVideoImage(server.url, 'video_short.webm', videoDetails.thumbnailPath)
- expect(test).to.equal(true)
-
- videoId = videoDetails.id
- videoUUID = videoDetails.uuid
-
- const torrent = await webtorrentAdd(magnetUri)
- expect(torrent.files).to.be.an('array')
- expect(torrent.files.length).to.equal(1)
- expect(torrent.files[0].path).to.exist.and.to.not.equal('')
- })
-
- it('Should get the video', async function () {
- // Yes, this could be long
- this.timeout(60000)
-
- const res = await getVideo(server.url, videoId)
-
- const video = res.body
- expect(video.name).to.equal('my super name')
- expect(video.category).to.equal(2)
- expect(video.categoryLabel).to.equal('Films')
- expect(video.licence).to.equal(6)
- expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
- expect(video.language).to.equal(3)
- expect(video.languageLabel).to.equal('Mandarin')
- expect(video.nsfw).to.be.ok
- expect(video.description).to.equal('my super description')
- expect(video.serverHost).to.equal('localhost:9001')
- expect(video.accountName).to.equal('root')
- expect(video.isLocal).to.be.true
- expect(dateIsValid(video.createdAt)).to.be.true
- expect(dateIsValid(video.updatedAt)).to.be.true
- expect(video.channel.name).to.equal('Default root channel')
- expect(video.channel.isLocal).to.be.true
- expect(dateIsValid(video.channel.createdAt)).to.be.true
- expect(dateIsValid(video.channel.updatedAt)).to.be.true
-
- expect(video.files).to.have.lengthOf(1)
-
- const file = video.files[0]
- expect(file.magnetUri).to.have.lengthOf.above(2)
- expect(file.resolution).to.equal(720)
- expect(file.resolutionLabel).to.equal('720p')
- expect(file.size).to.equal(218910)
-
- const test = await testVideoImage(server.url, 'video_short.webm', video.thumbnailPath)
- expect(test).to.equal(true)
-
- // Wait the async views increment
- await wait(500)