- await wait(5000)
-
- // Server 1 follows server 3
- await follow(servers[0].url, [ servers[2].url ], servers[0].accessToken)
-
- await wait(7000)
-
- let res = await getVideosList(servers[0].url)
- expect(res.body.total).to.equal(7)
-
- const video2 = res.body.data.find(v => v.name === 'server3-2')
- const video4 = res.body.data.find(v => v.name === 'server3-4')
- const video6 = res.body.data.find(v => v.name === 'server3-6')
-
- expect(video2).to.not.be.undefined
- expect(video4).to.not.be.undefined
- expect(video6).to.not.be.undefined
-
- const res2 = await getVideo(servers[0].url, video4.id)
- const videoDetails = res2.body
-
- expect(videoDetails.name).to.equal('server3-4')
- expect(videoDetails.category).to.equal(2)
- expect(videoDetails.categoryLabel).to.equal('Films')
- expect(videoDetails.licence).to.equal(6)
- expect(videoDetails.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
- expect(videoDetails.language).to.equal(3)
- expect(videoDetails.languageLabel).to.equal('Mandarin')
- expect(videoDetails.nsfw).to.be.ok
- expect(videoDetails.description).to.equal('my super description')
- expect(videoDetails.serverHost).to.equal('localhost:9003')
- expect(videoDetails.accountName).to.equal('root')
- expect(videoDetails.likes).to.equal(1)
- expect(videoDetails.dislikes).to.equal(1)
- expect(videoDetails.isLocal).to.be.false
- expect(videoDetails.tags).to.deep.equal([ 'tag1', 'tag2', 'tag3' ])
- expect(dateIsValid(videoDetails.createdAt)).to.be.true
- expect(dateIsValid(videoDetails.updatedAt)).to.be.true
- 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(`${servers[2].url}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`)
- expect(file.fileUrl).to.equal(`${servers[2].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(servers[2].url, 'video_short.webm', videoDetails.thumbnailPath)
- expect(test).to.equal(true)
-
- 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('')
-
- {