+
+ it('Should have updated torrent hosts', async function () {
+ this.timeout(30000)
+
+ const res = await getVideosList(server.url)
+ const videos = res.body.data
+ expect(videos).to.have.lengthOf(2)
+
+ for (const video of videos) {
+ const res2 = await getVideo(server.url, video.id)
+ const videoDetails: VideoDetails = res2.body
+
+ expect(videoDetails.files).to.have.lengthOf(4)
+
+ for (const file of videoDetails.files) {
+ expect(file.magnetUri).to.contain('localhost%3A9002%2Ftracker%2Fsocket')
+ expect(file.magnetUri).to.contain('localhost%3A9002%2Fstatic%2Fwebseed%2F')
+
+ const torrent = await parseTorrentVideo(server, videoDetails.uuid, file.resolution.id)
+ const announceWS = torrent.announce.find(a => a === 'ws://localhost:9002/tracker/socket')
+ expect(announceWS).to.not.be.undefined
+
+ const announceHttp = torrent.announce.find(a => a === 'http://localhost:9002/tracker/announce')
+ expect(announceHttp).to.not.be.undefined
+
+ expect(torrent.urlList[0]).to.contain('http://localhost:9002/static/webseed')
+ }
+ }
+ })
+
+ after(async function () {
+ await cleanupTests([ server ])
+ })